https://github.com/joelthelion/autojump/wiki
Autojump: a cd command that learns
Flattr thisFor a quick introduction to Autojump, see this video.
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 you to enter almost the full path, which isn’t very practical and requires a lot of keystrokes.
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 jumpstat command shows you the current contents of the database. You need to work a little bit before the database becomes usable. Once your database is reasonably complete, you can “jump” to a commonly "cd"ed directory by typing:
j dirspecwhere 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. Note that autojump isn’t meant to be a drop-in replacement for cd, but rather a complement. Cd is fine when staying in the same area of the filesystem; autojump is there to help when you need to jump far away from your current location.
Autojump supports tab-completion. Try it! Autojump should be compatible with Bash 4 and zsh. Please report any problems!
Pierre Gueth contributed a very nice applet for freedesktop desktops (Gnome/KDE/…). It is called “jumpapplet”, try it!
Thanks to Simon Marache-Francisco’s outstanding work, autojump now works perfectly with zsh.
EXAMPLES
j mp3
could jump to “/home/gwb/my mp3 collection”, if that is the directory in which you keep your mp3s.
jumpstatwill 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: 1077The “key weight” reflects the amount of time you spend in a directory.
DOWNLOAD
Use the github dowloads to get the latest release, or use git to get the bleeding edge version (should usually work)
INSTALLATION
For automatic installation, make sure that install.sh is executable. If not (or if not sure), run
chmod +x install.shOnce it is executable, run
./install.shIt will tell you any necessary steps from there.
Manual installation of autojump is very simple: copy autojump to /usr/bin, autojump.sh to /etc/profile.d, and autojump.1 to /usr/share/man/man1. Make sure you source /etc/profile in your .bashrc:
source /etc/profileAUTHORS
Joel Schaerer (joel.schaerer (at) laposte.net) <— don’t hesitate to send feedback!
Autojump applet written by Pierre Gueth
Zsh support: Simon Marache-Francisco
Install script written by Daniel Jackoway and others.
LICENSE
autojump is distributed under the terms of the GPL, version 3.
DONATIONS
If you like autojump, you can (but there is really no pressure to do so!) make a small donation using the “flattr this” button on top of this page. You can also make a small bitcoin donation to the following address: 16RQWifjN68T3BP5wvpZSev9CbUMkMBcEJ . If you do, don’t hesitate to drop me a word by email; otherwise, I have no way to say thanks!
PACKAGING
For Arch Linux it is available from the [community] repository. Until Feb, 2011 there was a bug in Arch's packaging of bash, this has now been resolved. Make sure your bash package is at least bash-4.1.009-4.
Autojump is now officially a part of Debian Sid, thanks to Tanguy Ortolo’s work.
Thibault North contributed packages for Fedora. They should now be included in the distro. You can also install autojump on Redhat/CentOS using the EL5 / EL6 repos.
Olivier Mehani wrote an ebuild for gentoo. Thanks! It should now be integrated to portage, so you should be able to emerge it directly.
Autojump is officially supported in the rolling-release branch of Frugalware. Thanks to Fabien Bourgeois for making the package!
Binh Nguyen kindly provides a build script for Slackware
I would be very interested by packages for other distros. If you think you can help me with the packaging, please contact me! Note that apart from bash(zsh) and python, autojump doesn’t have any dependencies.
Note (tommy):Simple way steps:
- Decompress autojump package.
- export PATH=$PATH:/autojump
- source autojump.bash
Version python 2.6.x