Hi all,

One of the most used shell commands is "cd". A quick survey among my friends revealed that between 10 and 20% of all commands they type are actually cd commands! Unfortunately, jumping from one part of your system to another with cd requires to enter almost the full path, which isn't very practical and requires a lot of keystrokes.

To address this problem, I've created a little tool called autojump. Autojump is a faster way to navigate your filesystem. It works by maintaining a database of the directories you use the most from the command line. The jstat command shows you the current contents of the database. You need to work a little bit before the database becomes useable. Once your database is reasonably complete, you can "jump" to a directory by typing:

j dirspec

where dirspec is a few characters of the directory you want to jump to. It will jump to the most used directory whose name matches the pattern given in dirspec.

EXAMPLES

j mp3

could jump to /home/gwb/my mp3 collection, if that is the directory in which you keep your mp3s.

jstat

will print out something in the lines of:

...

54.5: /home/shared/musique

60.0: /home/joel/workspace/coolstuff/glandu

83.0: /home/joel/workspace/abs_user/autojump

96.9: /home/joel/workspace/autojump

141.8: /home/joel/workspace/vv

161.7: /home/joel

Total key weight: 1077

The "key weight" reflects the amount of time you spend in a directory.

To install,

yaourt -S autojump

You need to source /etc/profile in your .bashrc for this to work. Your terminal might also need restarting after the installation.

Last edited by lardon (2009-02-12 08:36:03)