For quick directory switching, consider the alternative approach of the built-in directory stack commands: dirs, pushd, popd.
A bit of scripting is then wanted to coerce the output of 'dirs' into a readable format.
A bit of scripting is then wanted to coerce the output of 'dirs' into a readable format.
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 alias cdp='cd ~/src/photostructure'
for example. I found I only really needed < 10 directories aliases in this fashion.