Many years ago I discovered CDPATH, and months later, I determined, never again will I walk into that valley of madness. It breaks so many things.
A bit of scripting is then wanted to coerce the output of 'dirs' into a readable format.
alias cdp='cd ~/src/photostructure'
for example. I found I only really needed < 10 directories aliases in this fashion. d () { dirs -p | nl -v 0; }
The numbers in the left-hand column correspond to offsets from top-of-stack. So, if you see $ d
0 ~
1 /var/log/apt
to switch back to /var/log/apt, you could type:
$ pushd +1