Z(1)

NAME

z - jump to frecent directories using zoxide-style history matching.

SYNOPSIS

z [keyword ...]
z -
z -- directory

DESCRIPTION

z is a Rush-specific regular builtin. It changes the current working directory using zoxide-style matching over Rush command history. It is not available in POSIX mode; use cd for portable directory changes.

With no arguments, z changes to $HOME. z - changes to $OLDPWD. If a single argument names an existing directory, z changes to it directly instead of querying history. z -- directory also changes directly to directory.

Otherwise, arguments are treated as query keywords. Rush searches directories recorded in command history, excluding the current directory, and chooses the highest frecency match.

MATCHING

Keyword matching mirrors zoxide's non-interactive query behavior:

For example, z ba can match /foo/bar, but z fo does not match /foo/bar because fo is not in the final path component.

RANKING

Rush derives zoxide-style frecency from command history. A directory's rank is the number of commands recorded from that directory, and its last access time is the newest recorded command time for that directory.

The frecency score is rank multiplied by an age factor:

less than 1 hour old
rank * 4.0
less than 1 day old
rank * 2.0
less than 1 week old
rank * 0.5
1 week old or older
rank * 0.25

EXIT STATUS

z returns zero after a successful directory change. It returns non-zero when no match is found, required state such as $HOME or $OLDPWD is missing, or the selected directory cannot be entered.

SEE ALSO

rush-builtins(7), cd(1), zoxide.