zoxide
A smarter cd command that learns your habits and jumps to your most-used directories instantly.
zoxide is a smarter cd command inspired by z and autojump. It tracks the
directories you visit most often and lets you jump back to them with just a few
keystrokes — no need to type out long paths ever again.
Features
- Frecency-based ranking — ranks directories by how frequently and recently you've visited them, so the most relevant one always wins
- Fuzzy jumping — type a partial directory name and zoxide figures out where you mean
- Interactive mode — pipe into
fzffor a visual, filterable directory picker - Shell agnostic — works with bash, zsh, fish, nushell, PowerShell, and more
- Drop-in replacement — can alias itself to
cdso you don't change any habits - Fast — written in Rust, database lookups are near-instant
Installation
cargo install zoxide
Or via your package manager:
# Debian/Ubuntu
apt install zoxide
# macOS
brew install zoxide
# Arch Linux
pacman -S zoxideSetup
Add the init snippet to your shell's config file:
# bash (~/.bashrc)
eval "$(zoxide init bash)"
# zsh (~/.zshrc)
eval "$(zoxide init zsh)"
# fish (~/.config/fish/config.fish)
zoxide init fish | source
# nushell (~/.config/nushell/config.nu)
zoxide init nushell | save -f ~/.zoxide.nu
To replace cd entirely, use the --cmd flag:
eval "$(zoxide init zsh --cmd cd)"Usage
# Jump to a directory you've visited before (partial match)
z projects
# Jump to the highest-ranked match for multiple tokens
z my rust project
# Open an interactive picker (requires fzf)
zi
# Add a directory manually to the database
zoxide add ~/some/path
# Show the current database, sorted by score
zoxide query --list --score
# Remove a stale directory from the database
zoxide remove ~/old/path
Once set up, your workflow changes naturally. Instead of:
cd ~/Projects/work/acme-corp/backend/src
You just type:
z backend
And zoxide takes you there.