zoxide - Man Page

a smarter cd command

Examples (TL;DR)


zoxide SUBCOMMAND [Options]


zoxide is a smarter cd command for your terminal. It keeps track of the directories you use most frequently, and uses a ranking algorithm to navigate to the best match.


z foo              # cd into highest ranked directory matching foo
z foo bar          # cd into highest ranked directory matching foo and bar
z foo /            # cd into a subdirectory starting with foo

z ~/foo            # z also works like a regular cd command
z foo/             # cd into relative path
z ..               # cd one level up
z -                # cd into previous directory

zi foo             # cd with interactive selection (using fzf)

z foo<SPACE><TAB>  # show interactive completions (bash 4.4+/fish/zsh only)



Add a new directory to the database, or increment its rank.


Import entries from another application.


Generate shell configuration.


Search for a directory in the database.


Remove a directory from the database.


-h,  --help

Print help information.

-V,  --version

Print version information.

Environment Variables

Environment variables can be used for configuration. They must be set before zoxide-init(1) is called.


Specifies the directory in which the database is stored. The default value varies across OSes:

   Linux/BSD$XDG_DATA_HOME or $HOME/.local/share, eg. /home/alice/.local/share
   macOS$HOME/Library/Application Support, eg. /Users/Alice/Library/Application Support
   Windows%LOCALAPPDATA%, eg. C:\Users\Alice\AppData\Local

When set to 1, z will print the matched directory before navigating to it.


Prevents the specified directories from being added to the database. This is provided as a list of globs, separated by OS-specific characters:

   Linux/macOS/BSD:, eg. $HOME:$HOME/private/*
   Windows;, eg. $HOME;$HOME/private/*

By default, this is set to $HOME. After setting this up, you might need to use zoxide-remove(1) to remove any existing entries from the database.


Custom options to pass to fzf(1) during interactive selection. See the manpage for the full list of options.


Configures the aging algorithm, which limits the maximum number of entries in the database. By default, this is set to 10000.


When set to 1, z will resolve symlinks before adding directories to the database.



zoxide uses a parameter called _ZO_MAXAGE to limit the number of entries in the database based on usage patterns. If the total FRECENCY of the directories in the database exceeds this value, we divide each directory's score by a factor k - such that the new total becomes ~90% of _ZO_MAXAGE. Thereafter, if the new score of any directory falls below 1, it is removed from the database.

Theoretically, the maximum number of directories in the database is 4 * _ZO_MAXAGE, although it is lower in practice.


Each directory in zoxide is given a score, starting with 1 the first time it is accessed. Every subsequent access increases the score by 1. When a query is made, we calculate frecency based on the last time the directory was accessed:

   Last access timeFrecency
   Within the last hourscore * 4
   Within the last dayscore * 2
   Within the last weekscore / 2
   Otherwisescore / 4

Reporting Bugs

For any issues, feature requests, or questions, please visit:



Ajeet D'Souza <98ajeet@gmail.com>

Referenced By

zoxide-add(1), zoxide-query(1), zoxide-remove(1).