zoxide cheat sheet
replaces cdJump to directories by frecency — a cd command that learns your habits.
Covers zoxide 0.9.9. Click any command for details & copy · press / to search.
zi with eza tree preview
export _ZO_FZF_OPTS="--preview 'eza --tree --level=2 --color=always {}' --preview-window=right:50%"
zi
Interactive directory picker where the fzf preview pane shows a two-level directory tree via eza — lets you visually confirm what's inside before jumping
Jump and immediately list contents
z proj && eza --long --git --icons
Jump to the best match for 'proj' and immediately show a rich long-listing with git status and icons — the zoxide+eza combo that replaces 'cd && ls -la'
Open file in bat from any matched dir
bat "$(zoxide query proj)/README.md"
Resolve the best-matching directory for a keyword and pipe it into bat to view a file — no need to cd first
ripgrep across a frecency-matched project
rg 'TODO' "$(zoxide query myapp)"
Use zoxide query to resolve a project path and pass it directly to ripgrep — search any tracked project without knowing its full path
Bulk-boost important directories
zoxide add ~/projects/critical --score 200
zoxide add ~/work/client --score 200
Manually set high scores on directories you always want to win — useful when a new project hasn't built up frecency yet but you know it should rank first
Audit and clean stale entries
zoxide query -l -s | awk '{print $2}' | while read d; do [ -d "$d" ] || echo "MISSING: $d"; done
List all tracked directories with scores and flag any that no longer exist on disk — then use zoxide remove to clean them up
SHELL INIT ORDER For zsh, eval \"$(zoxide init zsh)\" must come AFTER compinit in ~/.zshrc, or tab-completions will not register.
FRECENCY ALGORITHM zoxide uses a frecency score (frequency + recency). Each visit increments a counter by 1. At query time the score is multiplied by a recency factor: 4x if visited within the last hour, 2x within the last day, 0.5x within the last week, 0.25x otherwise. When the total score across all entries exceeds _ZO_MAXAGE, all scores are divided by a factor so the new total is ~90% of the limit, and any entry falling below 1 is dropped.
REQUIRES fzf FOR zi The zi command and -i / --interactive flag require fzf v0.51.0 or later. Without fzf installed, interactive selection will fail with an error.
_ZO_EXCLUDE_DIRS DEFAULT: $HOME is excluded by default. If you want zoxide to track your home directory itself, you must override _ZO_EXCLUDE_DIRS. After changing exclude patterns, use zoxide remove to clean up already-tracked entries that should now be excluded.
DATABASE LOCATION On macOS the database lives in ~/Library/Application Support/zoxide/db.zo. On Linux/BSD: ~/.local/share/zoxide/db.zo. Override with _ZO_DATA_DIR.
--cmd cd GOTCHA: Using --cmd cd to replace cd entirely does not work on Nushell or POSIX shells. On zsh/bash/fish it works well and makes zoxide completely transparent.
--no-cmd USE CASE: Use --no-cmd when you want to define your own wrapper functions around __zoxide_z and __zoxide_zi (e.g., to add logging or extra behavior) without conflicting with zoxide's generated definitions.
IMPORT ONCE zoxide import is a one-shot migration tool. Running it again without --merge will overwrite the database. With --merge it combines scores additively.