Skip to main content

zoxide Cheatsheet

zoxide is a smarter cd command that learns your habits and lets you jump to frequently-used directories with just a few keystrokes. Fuzzy matching, interactive selection, and native shell integration. 38K+ GitHub Stars, supports every major shell.

Updated: 2026-07-20·18 commands

Quick Start

``bash z projects # Jump to best-matching directory z my project # Multi-keyword search zi # Interactive selection (fzf) zoxide add /opt/myapp # Manually add a directory eval "$(zoxide init zsh)" # Enable in your shell `

Install & Setup

Get zoxide installed and integrated with your shell.

`bash # Install (via package manager) curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash # Or: brew install zoxide, winget install zoxide, etc.

# Add to your shell config (bash) echo 'eval "$(zoxide init bash)"' >> ~/.bashrc

# Add to your shell config (zsh) echo 'eval "$(zoxide init zsh)"' >> ~/.zshrc

# Add to fish echo 'zoxide init fish | source' >> ~/.config/fish/config.fish

# Migrate from original z or autojump zoxide import ~/.z `

Basic Usage

Jump around your filesystem with minimal keystrokes.

`bash z projects # Fuzzy jump to ~/work/projects z myproject # Jump to ~/src/myproject z my project # Multi-keyword: matches ~/my_projects z foo/bar # Sub-path matching zoxide add . # Add current directory to database zoxide add /opt/myapp # Add a specific directory zoxide remove /tmp/old # Remove a directory from database `

Interactive Mode

Use fzf-powered interactive selection when fuzzy matching returns too many options.

`bash zi # Interactive directory picker zi docs # Interactive, filtered to "docs" matches zoxide query -i work # Interactive query mode `

Query Options

Query the database directly without jumping.

`bash zoxide query docs # Print best match for "docs" (no jump) zoxide query -l project # List all matches for "project" zoxide query -i work # Interactive query using fzf zoxide query -exclude /tmp project # Exclude a directory from query `

Configuration

Customize zoxide's behavior to fit your workflow.

`bash # Use a different command name (e.g., 'j' instead of 'z') eval "$(zoxide init zsh --cmd j)"

# Don't register default commands (manual setup) eval "$(zoxide init zsh --no-cmd)"

# Set custom database path export _Z_DATA=$HOME/.zoxide_db

# Use with fish zoxide init fish | source

# Use with PowerShell iex (zoxide init powershell | Out-String) `

Expert Tips

`bash # Jump to the second-best match (when you want the other one) z foo bar

# Combine with fzf for advanced filtering z foo | fzf --preview 'ls -la {1}'

# Add multiple directories at once find . -type d -maxdepth 1 | xargs -I{} zoxide add {}

# Export and backup your database cp "$(_Z_DATA:-$HOME/.local/share/zoxide/db.zo)" ~/zoxide_backup.zo

# Use in scripts without interactive mode cd "$(zoxide query -l project | head -1)" ``

Basic Usage(8)

CommandLevel
z --help
Show zoxide help
Basic
z DIR
Jump to the best matching directory
Basic
z foo bar
Match directory with multiple keywords
Basic
zi
Interactively select a directory (fzf-based)
Basic
z foo/bar
Match using sub-path
Basic
zoxide add PATH
Manually add a directory to the database
Basic
zoxide remove PATH
Remove a directory from the database
Basic
zoxide add .
Add current directory to database
Basic

Query Options(4)

CommandLevel
zoxide query KEYWORD
Query matching directories (no jump)
Basic
zoxide query -l KEYWORD
List all matching directories (sorted by score)
Intermediate
zoxide query -exclude PATH
Exclude a directory from query results
Expert
zoxide query -i KEYWORD
Interactive query (select with fzf)
Intermediate

Install & Setup(3)

CommandLevel
zoxide init SHELL
Initialize zoxide integration for a shell
Basic
eval "$(zoxide init SHELL)"
Enable zoxide in .bashrc/.zshrc
Basic
zoxide import PATH
Import history from z (autojump, z.lua)
Intermediate

Configuration(3)

CommandLevel
zoxide init SHELL --cmd j
Use a custom command name (e.g. j instead of z)
Intermediate
zoxide init SHELL --no-cmd
Do not register default z/zi commands
Expert
export _Z_DATA=PATH
Specify z-compatible database path
Intermediate

FAQ

This cheatsheet is compiled from official tool documentation. Last updated: 2026-07-20.