Aside from aliasing and links, is there an easy way in Linux to tag commonly used directories and to navigate to a commonly used directory from the terminal.

To be clear the disadvantages I see with alternative approaches, and why I want a bookmark/favorites like system:

Too specific (every new favorite requires a new alias...although you could in theory make an alias that echo append your dir as a new alias, which would be sort of clever). Can't nest favorites in folders (can't think of a simple solution to this outside of heavy config scripting).

Clutter directory make ls a headache.

Non-permanent (without shell config file scripting), can't nest favorites in directories, etc.

Granted I have multiple ideas for making my own non-standard solution, but before I have at it I wanted to get some perspective on what's out there and if there is nothing, what is a recommended approach.

Does anyone know of such a favorites/bookmark-like terminal solution?

  • Many shells also have a $CDPATH; this could be combined with one or more of the other solutions, for example to reduce the clutter from links. by hiding them in a dot-directory and putting that in $CDPATH. – geekosaur Apr 25 '12 at 20:31
  • set doesn't do what you think it does. (Try echo $1 in the shell where you did that.) It's just CDPATH=whatever. – geekosaur Apr 25 '12 at 20:41
  • How to use that var, though? I thought it might allow me to say cd tools if I had a folder named ~/<dir>/<dir>/tools/, but no luck. – Jason R. Mick Apr 25 '12 at 20:45
  • What exactly did you set CDPATH to, for that? (Beware that ~ is not always expanded in such cases; you may want to use $HOME instead.) – geekosaur Apr 25 '12 at 20:50
  • Pretty much identical to the example above... tried it with $HOME and it still didn't work. e.g. COMMAND 1: CDPATH=$HOME/<dir>/<dir>/tools COMMAND 2:echo $CDPATH (displays full verbose path correctly) COMMAND 3:cd tools (yields bash: cd: tools: No such file or directory) – Jason R. Mick Apr 25 '12 at 21:00

Just to add my 2 cents.


qwe name : Traverse to directory tagged name
qwe -h : Help
qwe -l : List of saved tag
qwe -a name : Add a tag called name with the current folder"
qwe -d name : Remove a tag called name
qwe -p name : Print the directory tagged with name

To install, just store the script somewhere and source it in your .bashrc file.


cdargs is the best tool for bookmarking a directory : http://www.youtube.com/watch?v=uWB2FIQlzZg

  • And is available from cdargs package – Jakub Narębski Mar 6 '13 at 23:30

There is also bashmarks project (for bash shell), which uses one-letter commands for managing directory bookmarks:

s <bookmark_name> - Saves the current directory as "bookmark_name"
g <bookmark_name> - Goes (cd) to the directory associated with "bookmark_name"
p <bookmark_name> - Prints the directory associated with "bookmark_name"
d <bookmark_name> - Deletes the bookmark
l                 - Lists all available bookmarks

I use one-letter variables for temporal bookmarking, and properly named symlinks for permanent storage.


Apparix is a pure command-line implementation (that is, not menu-driven) for both bash and zsh of bookmarks. It is possible to jump to subdirectories of the bookmarks and tab-complete on those subdirectories. This is what gives it the most oomph.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.