DEV Community


Discussion on: Terminal Tricks: Directory Bookmarks

fenetikm profile image
Michael Welford • Edited

I know this is old but for anyone stumbling across this and they are using zsh then what you really want is to use hash to modify the command hash table so that you can then get an even shorter syntax and not need the extra aliases. E.g. if you run this:

hash -d o=~/Downloads/

you can then do:

$ cd ~o

or even:

$ ~o

or even even:

$ o

to change directory. You can also then substitute in ~o anywhere where you would usually place a path such as ls ~0.