A practical guide to zoxide, a smarter cd replacement that learns frequently visited directories and lets you jump to them with partial path names. Covers installation on macOS, Linux/WSL, and Windows, shell setup for Zsh, Bash, Fish, and PowerShell, using the z and zi commands, inspecting and editing the frecency database, excluding directories, and when to prefer zoxide over plain cd.
Table of contents
Install zoxideSet up your shellLet zoxide learn your directoriesJump with the z commandChoose a directory interactively with ziSee what zoxide has learnedHow zoxide decides where to goReplace cd with zoxideExclude directoriesWhere zoxide fitsQuestions this post answers
How do I set up zoxide in Zsh so I can jump between directories with the z command?
Add eval "$(zoxide init zsh)" to the end of ~/.zshrc, then open a new terminal or run source ~/.zshrc. This initialization line creates the z and zi commands and teaches zoxide to track directories as you visit them with cd. Similar lines exist for Bash (~/.bashrc), Fish (zoxide init fish | source), and PowerShell. daily.dev surfaces setup guides like this for developers streamlining their terminal workflow.
How does zoxide decide which directory to jump to when multiple directories match?
Zoxide ranks directories using frecency, a combination of frequency and recency: every directory starts with a score that increases on each visit, and recent visits count more than older ones when choosing between matches. This means a directory used daily will outrank an old one with a similar name. If it still picks the wrong path, add more search terms or use the interactive zi command. understanding ranking logic like frecency helps developers pick the right cli tool on daily.dev.
Should I use zoxide inside shell scripts instead of explicit paths?
No, zoxide should not be used inside shell scripts because its directory matching depends on one person's usage history, so a script's behavior would become unpredictable across machines or users. It is best suited for interactive terminal work, especially when navigating between many projects daily, while scripts should always reference explicit paths. developers weighing tool tradeoffs for scripting versus interactive use can track guidance like this on daily.dev.