Zoxide is really cool.

7 views
Skip to first unread message

Tom Peters

unread,
Jun 29, 2026, 5:56:05 PM (6 days ago) Jun 29
to Milwaukee Linux User's Group
I'm probably very late to the party, but I thought I'd share this. 

I've just installed zoxide everywhere. It's a tool you use in place of the cd command, and it learns as it goes what directories you visit and how often. Thereafter, you just type z and some fragment of the directory, and it does a cd to it. 
 
I live on the command line (bash) all day everyday, so this is really cool. Many of my machines don't even have a desktop. 
 
Typing
z comp
is certainly a lot better than 
cd /usr/share/bash-completion/completions
 
It learns and ranks most-used directories every time you use the cd command, or better, the z command. If you issue z and a path you can get to from where you are, it behaves exactly like the cd command. So both
cd /home
z /home
do exactly the same thing. but z ho does too. 
 
Install fzf (fuzzy find) and it does even more-- it pops up a box with the directories that match and lets you select one with arrow keys (when you use the zi command. The zi command with no args shows a list of the last 10 or 20 directories. Really slick. 
 
If anyone finds this interesting, I can post my notes on how to install it. I set up my Fedora and Ubuntu machines with it. 

-Tom

Tom

unread,
Jul 1, 2026, 5:34:28 PM (4 days ago) Jul 1
to Milwau...@googlegroups.com
Zoxide guide for Fedora and other Red Hat derived systems:
Note: I did this the hard way, because there was either no native package for some of my older systems, or because the package version available was pretty old. You can probably just do (for more recent OS)
dnf -y install zoxide
  or
apt install zoxide
 

DESCRIPTION

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.
Zoxide provides the zoxide command but also a z shortcut. Zoxide does this by memorizing directories you change to manually using the cd command or using the z command with an explicit directory path.

USAGE

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)
zi # Show a list of alll memorized dirs and allow choosing one

Installing zoxide on Fedora

Download zoxide-0.9.9-x86_64-unknown-linux-musl.tar.gz or the latest version.

Currently in /data/archive/Utilities/Zoxide/

Copy into /tmp

Also copy the profile script, zoxide.sh, either into /etc/profile.d or to /tmp, but then copy it to /etc/profile.d afterwards.

In any event, it should ultimately end up in /etc/profile.d

Extract it into /tmp tar xzvf zoxide-0.9.9-x86_64-unknown-linux-musl.tar.gz

Verify that it's some sort of Linux executable: (any sort of executable but it should not be a script)

 
file zoxide
zoxide: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, stripped
 

Change its owner to root: chown root:root zoxde

Copy the executable to /usr/local/bin

cp zoxide /usr/local/bin

 
Installing The man pages
 
cd into the man folder where you extracted the file, probably /tmp/man/man1
sudo install -Dm644 zoxide*.1 /usr/local/share/man/man1/
sudo mandb

Install the bash profile script

To effectively use zoxide, you have to install the zoxide.sh script into /etc/profile.d and then logout/back in- or source the file.
cp /zoxide.sh /etc/profile.d/
 
You can also copy all the lines from zoxide.sh into a bash.rc or .bashrc file.

Using Zoxide

Thereafter, zoxide will memorize directories you visit.

The first time you go to a given directory, either use the conventional cd command with a path, or use the z command with an explicit path.

You only have to do it once.

After the first time visiting any directory, zoxide will match a fragment of a directory name when you mention it with the z command.

If more than one directory matches what you type, it will go to the one you use more frequently.

Repeating the exact same command will go to another match.

Other zoxide commands

To manually add a directory:

zoxide add <dir>
But it's better to just use the z <dir> command.

To remove a memorized path:

zoxide remove <dir>

To use an interactive picker: You need fzf to be installed.

zi <directory>
Or just zi with no args.

History / database inspection:

zoxide query <directory>

List all tracked directories:

zoxide query -l

Show score of current working directory:

zoxide query -s

Show score of all directories:

zoxide query -sl

Use in scripts:

DIR=$(zoxide query proj)
cd "$DIR"

Other Information

The zoxide database is non-volatile and is maintained per-user in ~/.local/share/zoxide/db.zo

Zoxide uses a single local binary database file, not a traditional database engine like SQLite or Redis. It is a Rust-native serialized store.

 --
---
You received this message because you are subscribed to the Google Groups "Milwaukee Linux User's Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to MilwaukeeLUG...@googlegroups.com.
 
Reply all
Reply to author
Forward
0 new messages