Speed Up Linux Directory Navigation with Autojump: Installation & Usage Guide
This guide explains how to install the Autojump utility on Linux, configure it in your shell, and use its commands and options to quickly jump to frequently visited directories, including tips for handling common issues and understanding its weighting system.
Installation
Autojump requires Python 2.6+ or Python 3.3+. The example uses CentOS 7.5 with Python 2 installed. If Python 3 is needed, run the provided python3_install.sh script (place the two tar packages and the script in the same directory, then execute): sh python3_install.sh Download the source archive from GitHub, unzip it, and run the install or uninstall script:
unzip autojump-master.zip
cd autojump-master
./install.py # or ./uninstall.pyIf the installer does not automatically add the initialization line, append the following to ~/.bashrc:
[[ -s /root/.autojump/etc/profile.d/autojump.sh ]] && source /root/.autojump/etc/profile.d/autojump.shReload the shell configuration and verify the installation:
source ~/.bashrc
autojump --version # or j -vBasic Usage
After visiting a directory with cd, Autojump records it. Use autojump (or its short alias j) followed by a keyword to jump to the most frequently visited matching directory:
# j autojump
/root/autojump-masterWhen multiple subdirectories match, use jc followed by the subdirectory name:
# jc bin
/root/autojump-master/binOpen a graphical file manager at a matching directory with jo (or jco for a subdirectory). These commands require a desktop environment such as GNOME or KDE.
Command Options
-h – display help information
-a DIRECTORY – add a path manually
-i [WEIGHT] – increase weight of the current directory
-d [WEIGHT] – decrease weight of the current directory
--complete – enable tab completion
--purge – remove non‑existent paths from the database
-s – show database entries with their weights
-v – show version information
The short command j is interchangeable with autojump.
Advanced Tips & Limitations
Autojump only records directories entered via cd. Directories never visited with cd cannot be jumped to.
Paths that begin with a hyphen ( -) are not supported for automatic jumping.
Autojump tracks directory changes by modifying the $PROMPT_COMMAND variable in Bash. Do not overwrite this variable; if additional commands are needed, append them to the existing $PROMPT_COMMAND value.
Database files are stored under ~/.local/share/autojump/. Deleting or overwriting these files will lose the accumulated statistics.
Use j -s to inspect recorded weights. Higher weights indicate more frequent usage.
Repository
Official repository: https://github.com/wting/autojump
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
