1ZOXIDE(1) zoxide ZOXIDE(1)
2
3
4
6 zoxide - a smarter cd command
7
9 zoxide SUBCOMMAND [OPTIONS]
10
12 zoxide is a smarter cd command for your terminal. It keeps track of the
13 directories you use most frequently, and uses a ranking algorithm to
14 navigate to the best match.
15
17 z foo # cd into highest ranked directory matching foo
18 z foo bar # cd into highest ranked directory matching foo and bar
19 z foo / # cd into a subdirectory starting with foo
20
21 z ~/foo # z also works like a regular cd command
22 z foo/ # cd into relative path
23 z .. # cd one level up
24 z - # cd into previous directory
25
26 zi foo # cd with interactive selection (using fzf)
27
28 z foo<SPACE><TAB> # show interactive completions (bash 4.4+/fish/zsh only)
29
31 zoxide-add(1)
32 Add a new directory to the database, or increment its rank.
33
34 zoxide-import(1)
35 Import entries from another application.
36
37 zoxide-init(1)
38 Generate shell configuration.
39
40 zoxide-query(1)
41 Search for a directory in the database.
42
43 zoxide-remove(1)
44 Remove a directory from the database.
45
47 -h, --help
48 Print help information.
49
50 -V, --version
51 Print version information.
52
54 Environment variables can be used for configuration. They must be set
55 before zoxide-init(1) is called.
56
57 _ZO_DATA_DIR
58 Specifies the directory in which the database is stored. The de‐
59 fault value varies across OSes:
60
61 OS Path
62 Linux/BSD $XDG_DATA_HOME or
63 $HOME/.local/share, eg.
64 /home/alice/.local/share
65
66
67 macOS $HOME/Library/Application
68 Support, eg. /Users/Al‐
69 ice/Library/Application
70 Support
71 Windows %LOCALAPPDATA%, eg.
72 C:\Users\Alice\AppData\Lo‐
73 cal
74
75 _ZO_ECHO
76 When set to 1, z will print the matched directory before navi‐
77 gating to it.
78
79 _ZO_EXCLUDE_DIRS
80 Prevents the specified directories from being added to the data‐
81 base. This is provided as a list of globs, separated by OS-spe‐
82 cific characters:
83
84 OS Separator
85 Linux/macOS/BSD :, eg. $HOME:$HOME/private/*
86 Windows ;, eg. $HOME;$HOME/private/*
87
88 By default, this is set to $HOME. After setting this up, you
89 might need to use zoxide-remove(1) to remove any existing en‐
90 tries from the database.
91
92 _ZO_FZF_OPTS
93 Custom options to pass to fzf(1) during interactive selection.
94 See the manpage for the full list of options.
95
96 _ZO_MAXAGE
97 Configures the aging algorithm, which limits the maximum number
98 of entries in the database. By default, this is set to 10000.
99
100 _ZO_RESOLVE_SYMLINKS
101 When set to 1, z will resolve symlinks before adding directories
102 to the database.
103
105 AGING zoxide uses a parameter called _ZO_MAXAGE to limit the number of
106 entries in the database based on usage patterns. If the total
107 FRECENCY of the directories in the database exceeds this value,
108 we divide each directory's score by a factor k - such that the
109 new total becomes ~90% of _ZO_MAXAGE. Thereafter, if the new
110 score of any directory falls below 1, it is removed from the
111 database.
112
113 Theoretically, the maximum number of directories in the database
114 is 4 * _ZO_MAXAGE, although it is lower in practice.
115
116 FRECENCY
117 Each directory in zoxide is given a score, starting with 1 the
118 first time it is accessed. Every subsequent access increases the
119 score by 1. When a query is made, we calculate frecency based on
120 the last time the directory was accessed:
121
122 Last access time Frecency
123 Within the last hour score * 4
124 Within the last day score * 2
125 Within the last week score / 2
126 Otherwise score / 4
127
129 For any issues, feature requests, or questions, please visit:
130
131 https://github.com/ajeetdsouza/zoxide/issues
132
134 Ajeet D'Souza <98ajeet@gmail.com>
135
136
137
138 2021-04-12 ZOXIDE(1)