Skip to content
Teodor Heggelund edited this page Feb 1, 2018 · 5 revisions

This wiki is rarely updated. Please refer to the or man pages for up to date documentation.

Autojump: a cd command that learns

For 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 autojump -s 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 <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. 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.


j mp3

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

j --stat

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.


Use the github downloads to get the latest release, or use git to get the bleeding edge version (should usually work)


For automatic installation, make sure that is executable. If not (or if not sure), run

chmod +x

Once it is executable, run

It will tell you any necessary steps from there.

Manual installation of autojump is very simple: copy autojump to /usr/bin, to /etc/profile.d, and autojump.1 to /usr/share/man/man1. Make sure you source the appropriate file in your .bashrc:

source /etc/profile.d/

If you do not have root access to your machine, copy @autojump@ to a directory that is in the @PATH@ (for example, @$HOME/local/bin@), copy @autojump.bash@ somewhere convenient, and add @source /path/to/autojump.bash@ in your @.bashrc@.


Joel Schaerer William Ting Pierre Gueth (applet) Simon Marache-Francisco (zsh) Daniel Jackoway and others (installation)

Contact us:


autojump is distributed under the terms of the GPL, version 3.


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. (for policy reasons, it requires manual activation after installing, see /usr/share/doc/autojump/README.Debian).

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":

Thanks to Neeraj Verma's work, autojump is available as an official port for FreeBSD.

Autojump is also available on "Macports":

Homebrew has a formula for Autojump, simply brew install autojump

temporary way to install autojump

cd /usr/local
curl | git am
brew install autojump

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.