LINUXMIND.DEVTHE GNU/LINUX WORLD

LinuxMind trick: zoxide, stop typing cd into long paths

Flat editorial illustration of a branching folder tree where a bright lightning-bolt arrow leaps directly from the bottom to a folder near the top

LinuxMind trick — the daily one you will actually use. You are three directories deep in a project you opened this morning, and now you need the folder you were in twenty minutes ago. So you start typing: cd ../../.., then a half-remembered path, then tab, then tab again. There is a faster way, and it learns as you go.

Meet zoxide

zoxide is a smarter cd. It watches the directories you visit, ranks them by frecency — frequency plus recency — and then jumps you to the right one from a fragment of its name. You type z and two letters, and you are there, no matter where you are in the filesystem.

Install it

# Debian / Ubuntu
sudo apt install zoxide

# Fedora
sudo dnf install zoxide

# Arch / CachyOS
sudo pacman -S zoxide

Or, if you live in Cargo: cargo install zoxide.

Teach your shell about it

Add one line to your shell config. For Bash:

eval "$(zoxide init bash)"

For Zsh use zoxide init zsh, and for Fish zoxide init fish | source.

Use it like you have always wanted to

z proj        # jump to the best match for "proj"
z doc         # straight to your documents
z

Run z with no argument and it shows the ranked list of everywhere it thinks you go. The more you move around normally with cd, the smarter it gets — there is no database to fill in by hand.

Today’s move

Alias cd to z in your shell config and forget the deep paths exist. Everything you already type keeps working; you just stop counting ../. That is the LinuxMind trick: one line of config, and your fingers stop doing the navigation your machine could do for you. Run z on its own on day one to see what it already knows, and give the ranking a little traffic before you judge it.




Leave a Reply

Your email address will not be published. Required fields are marked *