Skip to content
rupa edited this page Sep 13, 2010 · 17 revisions

Spend a lot of time cd-ing around a complex directory tree?

j keeps track of where you’ve been, and how much time you spend there. Source it into your .bashrc, and then you can say j foo to jump to the most used directory that has the substring (actually regex) foo in it, or j foo bar for the directory that has both foo and bar

It tab completes out of its file ($HOME/.j), and tries a case sensitive match first, then tries to match without case sensitivity.

FAQ

  • How come j .. doesn’t work like cd ..?

j is not intended as a substitute for the cd command. You should still cd everywhere as you normally would. When you want to jump somewhere you have been, then type j substring to jump a directory in your often used list.

  • Why do the options for j use a double-dash -- instead of a single-dash -?

It’s quite possible you have directories named-liked-this. So we want you to be able to search for them using -. Directories named—like—this are less likely to be laying around, and quite frankly, I’d be mad at you for having them. A reasonable way to avoid the annoyance of typing --l, which is the only option intended to be used by a human, is to alias something to j --l, eg put alias jl='j --l' in your .bashrc.

Clone this wiki locally