zoxide replaces most of your cd typing with two or three letters, and its shell hook costs a few milliseconds per start. On an Apple M4 Mac, z prod landed in ~/projects/infra/terraform/prod from anywhere, and the init line added a median 6.0 ms to a zsh start; on Ubuntu it added 2.6 to 3.2 ms to bash. Speed is not where people trip. The matching rule, the rc file order and an import flag that changed in the latest release cause most of the “zoxide does not work” reports.
This refresh covers installing zoxide on macOS and Linux, the init line for zsh, bash and fish, z and zi, the fzf picker and Space-Tab completion, replacing cd, and importing history from z or autojump. Every command ran on zoxide 0.10.0 (tested November 2026 on macOS 27 and Ubuntu 24.04), with the older 0.9.x distro packages checked on their own VMs.
What zoxide costs, measured
Shell start time and lookup cost decide whether a directory jumper stays in an rc file. We timed 100 interactive shell starts with and without the init line, repeated three to nine times per platform, and timed 200 zoxide query calls. The Mac is an AWS-hosted Mac mini M4 that other jobs shared during the run (load average 5.5), which explains the wide spread on that row.
| Measurement | Without zoxide | With zoxide | Difference |
|---|---|---|---|
| zsh start, macOS 27 on M4 (avg of 100, 9 runs) | 15.54 to 31.62 ms | 22.16 to 39.59 ms | +2.5 to 10.5 ms, median +6.0 ms |
| bash start, Ubuntu 24.04 (avg of 100, 3 runs) | 15.40 to 15.84 ms | 18.51 to 18.78 ms | +2.7 to 3.2 ms |
| bash start, Ubuntu 26.04 (avg of 100, 3 runs) | 24.24 to 24.87 ms | 26.98 to 27.58 ms | +2.6 to 3.0 ms |
zoxide query, macOS, 14 entries (avg of 200) | n/a | 7.70 to 8.92 ms | about 6x a bare fork+exec (1.25 to 1.55 ms) |
zoxide query, Ubuntu, 5,000 entries (avg of 200) | n/a | 2.63 ms | 6.6x a bare fork+exec (0.40 ms) |
| Database size, 5,000 entries | n/a | 237,905 bytes | about 48 bytes per entry |
The ratio is the useful number, not the absolute one. On both platforms a query costs about six process launches. macOS launched processes roughly three times slower than the Linux VMs did, so the same call took 2.6 ms on Ubuntu and close to 8 ms on the Mac. Nobody feels 6 ms at a prompt. You would feel it in a script that calls zoxide query in a loop, so batch work belongs in one zoxide query --list call parsed once.
Step 1: Install zoxide on macOS or Linux
Distribution packages lag the upstream release, and 0.10.0 changed the import syntax, so the version you get decides which commands in Step 7 work. Homebrew and the upstream script deliver 0.10.0, while Ubuntu 24.04 ships 0.9.3 and Ubuntu 26.04 ships 0.9.8. Pick the source by how current you need to be:
- Homebrew: the normal route on macOS, current within days of a release, and the same formula works on Linux if you already run Linuxbrew.
- Distro package: one command, updates with the OS, but 0.9.x on current LTS releases, which use the older import syntax.
- Upstream install script: latest static binary into
~/.local/bin, no root needed, but you update it yourself.
On a Mac, install zoxide and fzf together. If Homebrew itself is not set up yet, our guide to stopping Homebrew auto update also shows how to keep each brew install fast.
brew install zoxide fzf
On the M4 running macOS 27, Homebrew poured the arm64_golden_gate bottles, zoxide 0.10.0 and fzf 0.75.0, and linked both into /opt/homebrew/bin.

The caveat about zsh completions in /opt/homebrew/share/zsh/site-functions is worth reading now, because it decides whether Space-Tab works in Step 5. Intel Macs use /usr/local as the prefix instead, and everything else in this guide is the same on both.
On Ubuntu or Debian, install both from the archive.
sudo apt update
sudo apt install -y zoxide fzf
On Fedora the packages sit in the main repository, and we got zoxide 0.9.8 with fzf 0.74.5 there.
sudo dnf install -y zoxide fzf
For the current release on any Linux box, the upstream script detects the architecture and drops a static binary into your home directory. It does not install fzf. Two zoxide copies on PATH shadow each other, so on Ubuntu we kept the apt fzf and removed the apt zoxide first.
sudo apt remove -y zoxide
On Fedora the equivalent is sudo dnf remove zoxide. Then run the installer as your normal user, not with sudo.
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
The script reports the detected target, the install path and the man pages, and the binary answers with 0.10.0:

Our run also printed Note: /home/klinsmann/.local/bin is not on your $PATH, which is true for the non-login SSH command we used and becomes a real problem in Step 3. Keep that line in mind before you add the init line to .bashrc.
Step 2: Add fzf for the interactive picker
zoxide works without fzf, but zi and the Space-Tab completion both hand the candidate list to fzf, so without it you lose the two features that resolve ambiguous names. The brew, apt and dnf commands in Step 1 already pulled fzf in. After a script install, add it with sudo apt install -y fzf or sudo dnf install -y fzf. Confirm the version, because the zoxide 0.9.8 changelog raised the minimum supported fzf to 0.51.0:
fzf --version
Ubuntu 24.04 reported a version older than that floor:
0.44.1 (debian)
We expected zi to fail with fzf 0.44.1, and it did not. The picker opened, filtered and previewed normally with zoxide 0.10.0. The changelog calls 0.51.0 the minimum supported version, so an older fzf covers the basics but is not what upstream tests against. If a picker flag misbehaves on 24.04, install fzf from Homebrew or the fzf release page before blaming zoxide. Homebrew (0.75.0), Fedora 44 (0.74.5) and Ubuntu 26.04 (0.67.0) all clear the floor.
Step 3: Hook zoxide into zsh, bash or fish
The init line defines z and zi and installs the hook that scores every directory you enter. It has to be the last line of your rc file. zsh is the default shell on macOS, so on a Mac it goes at the end of ~/.zshrc, after the Homebrew line that puts zoxide on PATH. The Homebrew installer usually puts that line in ~/.zprofile, which zsh reads first, so do not add a second copy.
echo 'eval "$(zoxide init zsh)"' >> ~/.zshrc
After opening a new terminal, type z zi should name both as shell functions from .zshrc, and the empty count confirms nothing was recorded yet. This is the whole .zshrc of the test account on the Mac:

On a configured Mac the line usually sits below the Homebrew, Oh My Zsh and Powerlevel10k blocks, since anything loaded later that redefines cd or resets the chpwd hooks cuts zoxide off. zoxide 0.9.7 and later check for this on each z call. We reproduced it by clearing chpwd_functions after the init line on Fedora 44.

On Fedora the directory was already in the database, so the jump still worked and the warning was the only symptom. On a fresh Ubuntu 26.04 account (apt zoxide 0.9.8) the same .zshrc printed the warning and then zoxide: no match found, because the cleared hook never recorded the directory at all. The 0.9.3 package on Ubuntu 24.04 printed nothing and failed the same way. Move the init line below whatever resets the hook rather than silencing it with _ZO_DOCTOR=0.
For bash, append the line to ~/.bashrc instead.
echo 'eval "$(zoxide init bash)"' >> ~/.bashrc
That line alone broke our first SSH login on Ubuntu when zoxide came from the install script. The stock ~/.profile on Ubuntu sources ~/.bashrc at line 15 and only adds ~/.local/bin to PATH at line 26. In a login shell the init therefore runs before the binary is reachable, and bash prints Command 'zoxide' not found. A desktop terminal hides the bug because it inherits PATH from the session. Export the path inside .bashrc, directly above the init line.
sed -i '/zoxide init bash/i export PATH="$HOME/.local/bin:$PATH"' ~/.bashrc
After a fresh login, type z shows the function and the database count reads zero.

Readers who installed from apt can skip the export, because /usr/bin is on PATH before .bashrc runs. The same ordering rule applies to brew shellenv on both platforms, which has to sit above the zoxide line, as it does in the Mac capture above. A script install used from zsh needs the ~/.local/bin export too, because zsh never reads ~/.profile.
fish uses a pipe instead of eval. We tested it on fish 4.6.0, where z prod resolved and both z and zi were defined as functions. Anyone who runs fish as a daily shell, as in our fish and Oh My Fish setup on Fedora, adds it to the end of config.fish.
echo 'zoxide init fish | source' >> ~/.config/fish/config.fish
Open a new shell after editing any of these files. Sourcing the rc file in the current shell also works, but a new login is the only test that catches the PATH order problem above.
Step 4: Jump with z and read the scores
zoxide learns only from directories you actually enter, so the first hour feels like plain cd. On the Mac we built a small tree of projects and entered each one a different number of times, returning to ~ between visits, because entering the directory you are already in does not count. The database then held these scores.
zoxide query --list --score
Each directory gains 1 per visit, and the score is multiplied by 4 at query time when the last visit was within the hour. That is why api-gateway/src, visited 7 times, reads 28.0. The listing also shows where macOS keeps the data. A single 557-byte db.zo held these eight entries, under ~/Library/Application Support/zoxide rather than the Linux default of ~/.local/share/zoxide.

The multiplier drops to 2 within a day, to 0.5 within a week and to 0.25 after that, according to the zoxide algorithm notes, and Step 7 shows that aging on real imported data. Your home directory never appears in the list, because _ZO_EXCLUDE_DIRS defaults to $HOME. With that database in place, we ran a set of jumps from ~.
z api
z api src
z prod
z terra stag
z -
z mig
z ..
The first result is the one that surprises people. z api went to ~/old/projects/api-gateway with a score of 4, not to ~/projects/api-gateway/src with 28.

That is the matching rule working as designed, and the Ubuntu run produced the identical sequence of directories. zoxide only considers paths that satisfy all of these, and ranks the survivors by score:
- Case-insensitive match:
z PRODandz prodresolve the same way. - All keywords, in order:
z terra stagneedsterrato appear beforestagin the path. - Last keyword on the last component:
apidoes not match.../api-gateway/src, becausesrcis the last component. Only the old checkout ends inapi-gateway.
So name the end of the path you want, and add a parent keyword only to break a tie, as z api src did. The other forms behave like cd. z - returns to the previous directory, z .. goes up one level, and an absolute or relative path such as z ~/notes/2026 is followed literally and still recorded.
Step 5: Pick a directory with zi and Space-Tab
When several directories share a name, z picks the top score silently, and that is not always the one you want. zi opens the same ranked list in fzf with a preview of what each directory holds. Run it with no argument to browse everything, then type to filter.
zi
On the Mac, typing terra cut 9 entries down to 2, and the preview pane listed the four .tf files in the highlighted directory. We moved down one row and pressed Enter, and pwd then read /Users/klinsmann/projects/infra/terraform/staging.

fzf filters fuzzily across the whole path, so terra matches here. Typed as an argument, zi terraform returned zoxide: no match found on our first Ubuntu try, because no stored path ends in terraform. If a keyword fails, run zi bare and type the filter inside the picker.
Space-Tab does the same from the z command line. Type z, a keyword and a space, then press Tab. The README lists it for bash 4.4 and later and for fish as well; we tested it in zsh. It failed the first time on the Mac. A new macOS account has no compinit in its .zshrc, and without the zsh completion system Tab fell back to listing the subdirectories of ~. The zoxide README says the init line must come after compinit, so the .zshrc on the Mac needs these two lines between the Homebrew line and the zoxide line.
autoload -Uz compinit
compinit
Our second attempt stopped at zsh compinit: insecure directories and files, run compaudit for list. On the test Mac, /opt/homebrew/share was group writable (drwxrwxr-x) and owned by a different account from the one running the shell. The Homebrew shell completion page says to run compaudit and remove group or world write access only from the directories it reports, never recursively across the prefix. Homebrew belonged to another user on that Mac, so we started the lab account with compinit -u. That flag loads the flagged directories without the security check, so use it only when another account owns the prefix and fix the permissions on a Mac you own. Then z src followed by Space and Tab opened the picker with three directories ending in src.

Typing bill and Enter rewrote the line to z /Users/klinsmann/projects/billing-service/src and ran it. The full path lands in your shell history, which is useful later because the history shows where you actually went, not the abbreviation. Space-Tab needs at least one keyword before the space. With only z and a space, Tab falls back to ordinary directory completion, which is also what you see when compinit is missing.
Step 6: Replace cd with zoxide
If you want the habit without retraining your fingers, --cmd cd renames the two functions to cd and cdi. Change the init line in ~/.zshrc (or ~/.bashrc with bash) to read as follows.
eval "$(zoxide init zsh --cmd cd)"
In our zsh session, cd prod went straight to ~/projects/infra/terraform/prod, cd /etc/ssh behaved like the builtin, and type cd cdi reported both as shell functions. z no longer existed and returned zsh: command not found: z, so any alias or script that calls z needs updating. We would keep the default names on shared servers and use --cmd cd only on a personal machine. On a shared box, a colleague typing cd prod into your account and landing somewhere unexpected is a real risk.
Step 7: Import history from z or autojump
Years of z or autojump history carry over, so you do not start from an empty database. The command changed in 0.10.0. The source is now a subcommand, and the old --from flag fails. On the 0.10.0 binary, import from a z datafile and an autojump database with these two lines.
zoxide import z --merge
zoxide import autojump --merge
On the Mac we ran the old syntax first to capture the error, then the new one without --merge, which zoxide refuses on a database that already has entries.

The ~/src/kernel entry carried a z rank of 42, yet it arrived at 10.5. Its timestamp was 1 November 2026, more than a week before the import on 24 November, so zoxide applied the 0.25 multiplier to get 42 times 0.25. The same rank imported on Fedora (0.9.8) with a timestamp from the same hour came in at 168.0, which is 42 times 4. An imported history is ranked by how recently z last saw each directory, so expect old favourites to sit below anything you visited today until you use them again.
Auto-detection follows the paths of each platform. On macOS, 0.10.0 found the autojump database at ~/Library/autojump/autojump.txt. Its /var/log entry at weight 12.5 showed up at the bottom of the full list with a score of 0.2. On Ubuntu it read ~/.local/share/autojump/autojump.txt, and the z and autojump entries for the same path merged into one, which is why kernel read 172.0 there: 42 plus 1 from autojump, times 4.

The other import sources are atuin, fasd, z.lua and zsh-z. On 0.9.x, including the Ubuntu and Fedora packages, the flag syntax is still the only one that works. On Fedora, zoxide import --help printed Usage: zoxide import [OPTIONS] --from <FROM> <PATH>, so pass the file path explicitly there.
zoxide import --from z ~/.z --merge
Check zoxide --version before copying import commands from older guides, including the earlier version of this one.
Step 8: Tune the database
zoxide reads its settings from environment variables, and they must be exported before the init line runs. The table lists the ones worth setting on a working machine.
| Variable | Default | What it changes |
|---|---|---|
_ZO_EXCLUDE_DIRS | $HOME | Colon-separated globs never added to the database |
_ZO_DATA_DIR | ~/Library/Application Support/zoxide (macOS), $XDG_DATA_HOME/zoxide or ~/.local/share/zoxide (Linux) | Absolute path of the directory that holds db.zo, used as given |
_ZO_MAXAGE | 10000 | Total score at which aging divides every score and drops entries below 1 |
_ZO_ECHO | unset | Set to 1 to print the matched path before jumping |
_ZO_RESOLVE_SYMLINKS | unset | Set to 1 to store the resolved target of a symlinked path |
_ZO_FZF_OPTS | zoxide’s built-in fzf flags | Custom flags for the zi picker |
Excluding scratch space is the one change we would make everywhere, because build and temp directories otherwise crowd the top of the list after a busy day. Put this line above the init line in ~/.zshrc, keeping $HOME in the list so the default is not lost.
export _ZO_EXCLUDE_DIRS="$HOME:/tmp/*"
After entering /tmp/scratch/build and /etc/ssh, only /etc/ssh showed up in zoxide query --list. On a Mac, /tmp is a symlink to /private/tmp, so add /private/tmp/* as well if you set _ZO_RESOLVE_SYMLINKS=1. Entries recorded before an exclusion existed clean themselves up on 0.9.5 and later. On the 0.10.0 box, an /etc/ssh entry vanished on the first query run with /etc/* added to the list, while the 0.9.3 apt package on Ubuntu 24.04 left it in place. For any single entry you no longer want, remove it directly.
zoxide remove /etc/ssh
A follow-up zoxide query --list | grep -c etc returned 0. The aging default needs no tuning for a single user. Our 5,000 synthetic entries had a raw score of 1 each, half the 10,000 limit, and none were dropped. Entries for directories that no longer exist are pruned lazily once they are older than 90 days, so deleted project folders clean themselves up.
Which zoxide version each package source ships
The version table matters more than usual for zoxide, because the import syntax and the zsh doctor both depend on it. Every row below was installed in our lab, the Homebrew row on the M4 and the others on their own Linux VMs, except Debian 13, which comes from packages.debian.org.
| Source | zoxide | fzf | Import syntax |
|---|---|---|---|
| Homebrew (macOS 27, Apple silicon) | 0.10.0 | 0.75.0 | zoxide import z |
| Upstream install script | 0.10.0 | not included | zoxide import z |
| Fedora 44 repo | 0.9.8 | 0.74.5 | --from z <path> |
| Ubuntu 26.04 archive | 0.9.8 | 0.67.0 | --from z <path> |
| Ubuntu 24.04 archive | 0.9.3 | 0.44.1 | --from z <path> |
| Debian 13 archive | 0.9.7 | 0.60.3 | --from z <path> |
For a laptop, Mac or Linux, use Homebrew or the upstream script to get the CDPATH support, atuin import and the 0.10.0 fixes. On servers that only need z and zi, the distro package is fine, and it pairs well with a tmux session, where every new pane starts a fresh shell and reads the same database. The full changelog sits on the zoxide releases page. If you are still choosing a shell to pair it with, our comparison of Linux and macOS shells covers how bash, zsh and fish differ beyond the init line.
For zsh you’ll want to add
eval “$(zoxide init zsh)”
to your .zshrc file, not eval “$(zoxide init bash)”