j
Jump to frequently visited directories
TLDR
View documentation for the original command
SYNOPSIS
j [options] [directory_name]
PARAMETERS
<partial_name>
Jumps to the best matching directory in the database containing partial_name.
This is the most common usage.
-s, --stat
Shows statistics about the autojump database.
Includes total entries and frequently used directories.
-a, --add [path]
Adds the current directory (or specified path) to the autojump database manually.
Useful for ensuring a specific location is tracked immediately.
-i, --increase path
Increases the weight of a specified directory path.
Makes it more likely to be matched in the future.
-d, --decrease path
Decreases the weight of a specified directory path.
Makes it less likely to be matched.
--purge
Removes invalid or non-existent directory entries from the database.
Helps keep the database clean.
--help
Displays a help message with available options and usage information.
--version
Shows the installed version of the autojump utility.
DESCRIPTION
The j command, most commonly associated with the autojump utility, is a navigation tool for the command line.
It allows users to quickly change directories by typing only a partial name of a directory they have visited before.
autojump maintains a database of visited directories and assigns a 'weight' to them based on frequency and recency of access.
When you use j followed by a partial directory name, it searches this database for the best match based on the input and the directory weights, then automatically navigates you to that location.
This significantly speeds up navigation compared to manually typing out full paths or using traditional cd commands, especially for deep or frequently accessed directories.
Note that j is not a standard built-in shell command and requires the autojump package (or a similar utility) to be installed and configured in your shell's startup file.
CAVEATS
The j command is not a standard component of most Linux distributions and requires separate installation (typically via a package manager like apt, yum, or brew).
After installation, it needs to be sourced within your shell's startup file (e.g., ~/.bashrc, ~/.zshrc, etc.) for the command to be available in your session.
The accuracy of the jump depends on the partial name provided and the learned directory weights; ambiguous inputs might lead to unexpected destinations.
<B>SHELL INTEGRATION REQUIRED</B>
For j (autojump) to work, you must add a line to your shell configuration file (like ~/.bashrc, ~/.zshrc, etc.) that sources the autojump script.
The exact line varies depending on your shell and installation method, but it's often something like . /usr/share/autojump/autojump.sh or similar.
You typically need to restart your shell or source the config file after installation and setup for the command to become active.
<B>DATABASE MANAGEMENT</B>
autojump automatically builds its database as you navigate directories using cd or j.
The database is usually stored in a file like ~/.local/share/autojump/autojump.db.
The --purge option is useful for cleaning up the database by removing entries for directories that no longer exist.
HISTORY
Directory jumping utilities like autojump were developed to improve command-line navigation efficiency, building on the idea that users frequently revisit the same directories.
They aim to be faster and more intuitive than traditional methods like remembering and typing long paths or relying heavily on shell history.
autojump became a popular open-source implementation of this concept, influencing subsequent tools in this category.
SEE ALSO
cd, pushd, popd, fasd, zoxide