2021-09-27 23:22:27 +00:00
|
|
|
.TH "ZOXIDE" "1" "2021-04-12" "" "zoxide"
|
2021-04-15 13:47:15 +00:00
|
|
|
.SH NAME
|
2021-09-27 23:22:27 +00:00
|
|
|
\fBzoxide\fR - a smarter cd command
|
2021-04-15 13:47:15 +00:00
|
|
|
.SH SYNOPSIS
|
2021-09-27 23:22:27 +00:00
|
|
|
.B zoxide SUBCOMMAND [OPTIONS]
|
2021-04-15 13:47:15 +00:00
|
|
|
.SH DESCRIPTION
|
2021-09-27 23:22:27 +00:00
|
|
|
zoxide is a smarter cd command for your terminal. It keeps track of the
|
2021-04-15 13:47:15 +00:00
|
|
|
directories you use most frequently, and uses a ranking algorithm to navigate
|
|
|
|
to the best match.
|
|
|
|
.SH USAGE
|
2021-05-17 16:16:42 +00:00
|
|
|
.nf
|
2022-02-25 04:19:45 +00:00
|
|
|
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
|
2021-04-15 13:47:15 +00:00
|
|
|
.sp
|
2022-02-25 04:19:45 +00:00
|
|
|
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
|
2021-04-15 13:47:15 +00:00
|
|
|
.sp
|
2022-02-25 04:19:45 +00:00
|
|
|
zi foo # cd with interactive selection (using fzf)
|
|
|
|
.sp
|
|
|
|
z foo<SPACE><TAB> # show interactive completions (bash 4.4+/fish/zsh only)
|
2021-05-17 16:16:42 +00:00
|
|
|
.fi
|
2021-04-15 13:47:15 +00:00
|
|
|
.SH SUBCOMMANDS
|
|
|
|
.TP
|
|
|
|
\fBzoxide-add\fR(1)
|
|
|
|
Add a new directory to the database, or increment its rank.
|
|
|
|
.TP
|
|
|
|
\fBzoxide-import\fR(1)
|
|
|
|
Import entries from another application.
|
|
|
|
.TP
|
|
|
|
\fBzoxide-init\fR(1)
|
|
|
|
Generate shell configuration.
|
|
|
|
.TP
|
|
|
|
\fBzoxide-query\fR(1)
|
|
|
|
Search for a directory in the database.
|
|
|
|
.TP
|
|
|
|
\fBzoxide-remove\fR(1)
|
|
|
|
Remove a directory from the database.
|
|
|
|
.SH OPTIONS
|
|
|
|
.TP
|
|
|
|
.B -h, --help
|
2021-05-26 21:04:01 +00:00
|
|
|
Print help information.
|
2021-04-15 13:47:15 +00:00
|
|
|
.TP
|
|
|
|
.B -V, --version
|
2021-05-26 21:04:01 +00:00
|
|
|
Print version information.
|
2021-04-15 13:47:15 +00:00
|
|
|
.SH ENVIRONMENT VARIABLES
|
2021-09-28 22:33:29 +00:00
|
|
|
Environment variables can be used for configuration. They must be set before
|
|
|
|
\fBzoxide-init\fR(1) is called.
|
2021-04-15 13:47:15 +00:00
|
|
|
.TP
|
|
|
|
.B _ZO_DATA_DIR
|
2021-09-27 23:22:27 +00:00
|
|
|
Specifies the directory in which the database is stored. The default value
|
|
|
|
varies across OSes:
|
2021-04-15 13:47:15 +00:00
|
|
|
.TS
|
|
|
|
tab(|);
|
|
|
|
l l.
|
|
|
|
\fBOS|Path\fR
|
2021-09-27 23:22:27 +00:00
|
|
|
\fBLinux/BSD\fR|T{
|
|
|
|
\fB$XDG_DATA_HOME\fR or \fB$HOME/.local/share\fR, eg.
|
|
|
|
\fB/home/alice/.local/share\fR
|
2021-04-15 13:47:15 +00:00
|
|
|
T}
|
2021-09-27 23:22:27 +00:00
|
|
|
\fBmacOS\fR|T{
|
|
|
|
\fB$HOME/Library/Application Support\fR, eg.
|
|
|
|
\fB/Users/Alice/Library/Application Support\fR
|
2021-04-15 13:47:15 +00:00
|
|
|
T}
|
2021-09-27 23:22:27 +00:00
|
|
|
\fBWindows\fR|T{
|
2022-02-27 13:40:08 +00:00
|
|
|
\fB%LOCALAPPDATA%\fR, eg. \fBC:\\Users\\Alice\\AppData\\Local\fR
|
2021-04-15 13:47:15 +00:00
|
|
|
T}
|
|
|
|
.TE
|
|
|
|
.TP
|
|
|
|
.B _ZO_ECHO
|
2021-09-27 23:22:27 +00:00
|
|
|
When set to 1, \fBz\fR will print the matched directory before navigating to it.
|
2021-04-15 13:47:15 +00:00
|
|
|
.TP
|
|
|
|
.B _ZO_EXCLUDE_DIRS
|
|
|
|
Prevents the specified directories from being added to the database. This is
|
|
|
|
provided as a list of globs, separated by OS-specific characters:
|
|
|
|
.TS
|
|
|
|
tab(|);
|
|
|
|
l l.
|
|
|
|
\fBOS|Separator\fR
|
2021-09-27 23:22:27 +00:00
|
|
|
\fBLinux/macOS/BSD\fR|T{
|
|
|
|
\fB:\fR, eg. \fB$HOME:$HOME/private/*\fR
|
2021-04-15 13:47:15 +00:00
|
|
|
T}
|
2021-09-27 23:22:27 +00:00
|
|
|
\fBWindows\fR|\fB;\fR, eg. \fB$HOME;$HOME/private/*\fR
|
2021-04-15 13:47:15 +00:00
|
|
|
.TE
|
|
|
|
.sp
|
2021-09-27 23:22:27 +00:00
|
|
|
By default, this is set to \fB$HOME\fR. After setting this up, you might need
|
2021-04-28 19:54:25 +00:00
|
|
|
to use \fBzoxide-remove\fR(1) to remove any existing entries from the database.
|
2021-04-15 13:47:15 +00:00
|
|
|
.TP
|
|
|
|
.B _ZO_FZF_OPTS
|
2021-12-20 15:59:11 +00:00
|
|
|
Custom options to pass to \fBfzf\fR(1) during interactive selection. See the
|
|
|
|
manpage for the full list of options.
|
2021-04-15 13:47:15 +00:00
|
|
|
.TP
|
|
|
|
.B _ZO_MAXAGE
|
|
|
|
Configures the aging algorithm, which limits the maximum number of entries in
|
2021-10-28 06:38:57 +00:00
|
|
|
the database. By default, this is set to 10000.
|
2021-04-15 13:47:15 +00:00
|
|
|
.TP
|
|
|
|
.B _ZO_RESOLVE_SYMLINKS
|
2021-09-27 23:22:27 +00:00
|
|
|
When set to 1, \fBz\fR will resolve symlinks before adding directories to
|
2021-04-15 13:47:15 +00:00
|
|
|
the database.
|
|
|
|
.SH ALGORITHM
|
|
|
|
.TP
|
|
|
|
.B AGING
|
|
|
|
zoxide uses a parameter called \fB_ZO_MAXAGE\fR to limit the number of entries
|
|
|
|
in the database based on usage patterns. If the total \fBFRECENCY\fR of the
|
|
|
|
directories in the database exceeds this value, we divide each directory's
|
2021-09-27 23:22:27 +00:00
|
|
|
score by a factor \fBk\fR - such that the new total becomes ~90% of
|
2021-04-15 13:47:15 +00:00
|
|
|
\fB_ZO_MAXAGE\fR. Thereafter, if the new score of any directory falls below
|
2021-09-27 23:22:27 +00:00
|
|
|
1, it is removed from the database.
|
2021-04-15 13:47:15 +00:00
|
|
|
.sp
|
|
|
|
Theoretically, the maximum number of directories in the database is
|
2021-09-27 23:22:27 +00:00
|
|
|
\fB4 * _ZO_MAXAGE\fR, although it is lower in practice.
|
2021-04-15 13:47:15 +00:00
|
|
|
.TP
|
|
|
|
.B FRECENCY
|
2021-09-27 23:22:27 +00:00
|
|
|
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
|
2021-04-15 13:47:15 +00:00
|
|
|
query is made, we calculate frecency based on the last time the directory was
|
|
|
|
accessed:
|
|
|
|
.TS
|
|
|
|
tab(|);
|
|
|
|
l l.
|
|
|
|
\fBLast access time\fR|\fBFrecency\fR
|
2021-09-27 23:22:27 +00:00
|
|
|
Within the last hour|score * 4
|
|
|
|
Within the last day|score * 2
|
|
|
|
Within the last week|score / 2
|
|
|
|
Otherwise|score / 4
|
2021-04-15 13:47:15 +00:00
|
|
|
.TE
|
|
|
|
.SH REPORTING BUGS
|
|
|
|
For any issues, feature requests, or questions, please visit:
|
|
|
|
.sp
|
2021-09-27 23:22:27 +00:00
|
|
|
\fBhttps://github.com/ajeetdsouza/zoxide/issues\fR.
|
2021-04-15 13:47:15 +00:00
|
|
|
.SH AUTHOR
|
2021-09-27 23:22:27 +00:00
|
|
|
Ajeet D'Souza <\fB98ajeet@gmail.com\fR>
|