mirror of
https://github.com/mbirth/wiki.git
synced 2024-11-09 13:16:45 +00:00
41 lines
1.5 KiB
Markdown
41 lines
1.5 KiB
Markdown
---
|
|
title: Wherever Change Directory
|
|
layout: default
|
|
created: 2009-02-22 13:40:40 +0100
|
|
updated: 2009-02-22 13:46:25 +0100
|
|
toc: false
|
|
tags:
|
|
- know-how
|
|
- software
|
|
- linux
|
|
- tools
|
|
---
|
|
[wcd](http://www.xs4all.nl/~waterlan/) 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`:
|
|
|
|
{% highlight bash %}
|
|
# wcd
|
|
function wcd {
|
|
/usr/local/bin/wcd.exe -i -K -G $HOME $*
|
|
. $HOME/wcd.go
|
|
rm $HOME/wcd.go
|
|
}
|
|
{% endhighlight %}
|
|
|
|
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).
|
|
|
|
<p><div class="noteclassic" markdown="1">
|
|
Before using it the first time, you might have to issue a `wcd -s` which will scan your $HOME.
|
|
</div></p>
|