Wherever Change Directory

By | 22 Feb 2009

wcd is a tool which catalogs all directories of your $HOME (can be configured to catalog the whole drive) and then lets you type wcd Desktop and switches over to your ~/Desktop from wherever you are. Or you can type wcd "Rammstein*" and it will show you a list of your Rammstein-albums of your ~/Music-directory and jump to your choice.

The Ubuntu-Package is very outdated, so you better download the file from the homepage. Unpack it in /usr/local:

/usr/local% sudo tar xvzf wcd-4.1.0-linux.tar.gz

This will put a wcd.exe to your /usr/local/bin which is the main executable. But wcd doesn’t work by directly calling it, you have to add a function to your shell. But the following code into your .bash_profile or .zshrc:

# wcd
function wcd {
    /usr/local/bin/wcd.exe -i -K -G $HOME $*
    . $HOME/wcd.go
    rm $HOME/wcd.go
}Code language: PHP (php)

This advises wcd to put the cd-command into a file ~/wcd.go which is afterwards sourced by your shell to actually complete the cd. You can also type wcd -g to start the graphical cd. The switches -i -K make wcd ignore cases and put it in color-mode (for the -g UI).

Leave a Reply

Your email address will not be published. Required fields are marked *

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)