🌐
GitHub
github.com › ajeetdsouza › zoxide
GitHub - ajeetdsouza/zoxide: A smarter cd command. Supports all major shells. · GitHub
# 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)
Starred by 37.9K users
Forked by 842 users
Languages   Rust 82.8% | Shell 14.3% | Just 1.5% | Nix 1.4%
🌐
GitHub
github.com › rupa › z
GitHub - rupa/z: z - jump around · GitHub
/path/to/z.sh cd around for a while to build up the db. PROFIT!! Optionally: Set $_Z_CMD to change the command name (default z). Set $_Z_DATA to change the datafile (default $HOME/.z). Set $_Z_MAX_SCORE lower to age entries out faster (default 9000). Set $_Z_NO_RESOLVE_SYMLINKS to prevent symlink resolution.
Starred by 17K users
Forked by 1.2K users
Languages   Shell 64.6% | Roff 35.0% | Makefile 0.4%
Discussions

What cd tool do you use, if any (Autojump, j, z, etc)?

I use cd. And on a rare occasion pushd and popd.

More on reddit.com
🌐 r/commandline
27
17
July 29, 2016
A better 'cd'
Try fish Shell It will auto-complete frequently used commands, like changing directory, and save you a lot of typing. More on reddit.com
🌐 r/linux
62
77
February 4, 2021
autocomplete - cd -1, -2, -3 etc in Z shell - Stack Overflow
How do you set up the Z shell such that typing cd - gives you a list of previously visited paths, and cd -1, -2, -3, etc. will then take you to the directories? More on stackoverflow.com
🌐 stackoverflow.com
zoxide: a smarter cd command, inspired by z and autojump, that remembers visited directories and allows you to jump directly to them
91 votes, 12 comments. A smarter cd command. Supports all major shells. Contribute to ajeetdsouza/zoxide development by creating an account on GitHub. More on reddit.com
🌐 r/rust
12
91
September 17, 2024
🌐
Medium
medium.com › quick-programming › using-zoxide-to-superpower-your-cd-command-in-linux-e74d9327ced9
Using Zoxide to superpower your `cd` command in Linux | by mbvissers | Quick Programming | Quick Programming | Medium
April 1, 2025 - When you first install Zoxide you should use it just as you would use your regular cd . It will automatically build up a small local database of every directory you browse to.
🌐
DEV Community
dev.to › kelvinhey › how-to-install-zoxide-on-linux-5ah2
How to install Zoxide on Linux - DEV Community
November 2, 2024 - To start using Zoxide, navigate to some directories as you would with cd, but use the z command instead.
🌐
Linux Uprising
linuxuprising.com › 2019 › 02 › zlua-faster-way-of-changing-directories.html
z.lua - A Faster Way Of Changing Directories (cd Command That Learns As You Use It) - Linux Uprising Blog
July 1, 2019 - Quickly go back to a parent directory instead of typing cd ../../.. Similar experience in different shells and operating systems. Compatible with Lua 5.1, 5.2 and 5.3+ z.lua also comes with some options which let you change the command, exclude directories from matching, and it can even import data from z.sh or autojump.
🌐
DEV Community
dev.to › chamal1120 › zoxide-a-faster-alternative-to-boring-cd-command-1ae3
zoxide - A faster alternative to boring cd command - DEV Community
May 19, 2024 - echo 'alias cd="z"' >> ~/.zshrc · source ~/.zshrc · For further actions, you may consider blocking this person and/or reporting abuse · Chamal Mallawaarachchi · Follow · Hello, Welcome to my DEV blog! 👋 I love unix tooling and programming. Location · Kurunegala, Sri Lanka · Education · UG @ SLTC, Sri Lanka · Pronouns · He/him · Joined · Feb 16, 2024 · Cron Jobs for absolute beginners · #ubuntu #linux #devops #powerautomate Setup Haskell for Neovim on Linux ·
🌐
Reddit
reddit.com › r/linux › a better 'cd'
r/linux on Reddit: A better 'cd'
February 4, 2021 -

Plain 'cd' is all well and good - but I find myself re-typing the same old paths time and again as I bop about the file system.

It gets tedious even though TAB completion helps a lot.

For many years I used a pushd/popd wrapper called acd-func - but pushd/popd's stack is local to every session and is ephemeral hence I lost my breadcrumbs every time I logged in or jumped to another terminal window.

So I wrote ccd - it keeps a permanent store of directories that I visit and uses fzf to let me choose one. It also offers the directories under $PWD.

To try it out, install fzf, download and chmod +x ccd to your $PATH and do this:

source <( ccd -x )

Now you have a new 'cd' using fzf and the persistent store of breadcrumbs. If you like it, put that line into your .bashrc, log out and log back in again. All your terminals (and the system console) will see the same persistent store. More details in:

ccd -h

... written in bash, for bash - but it seems to work in zsh too. It's not working in fish yet.

Enjoy! If you like it and decide to use it, feel free to give me an upvote here, for encouragement.

EDIT: pardon the interregnum but I just became a grandad again!! Much excitement chez moi.

thanks to everyone suggesting alternative solutions, it's an interesting discussion to have and I've looked at them all. Some of them (like autojump, z, fasd) are far more ambitious than my 100 lines of bash (excl comments/fluff). Each to his own, of course, I'd encourage folks to try them all out and choose. Even though some of these projects can be adapted in some way to fit my workflow (and are far more impressive than my little script) I'm sticking with my own concoction because:

  • it fits my flow - 'cd' is still 'cd' and I don't have to re-train my fingers. Same with 'cd -' and 'cd --' which work very much like the old acd-func script.

  • perhaps because of that, TAB completion works the same as before

  • it uses fzf which I've grown to like - it really lets me be lazy and vague (ie human) while selecting something. Possibly because it's quite like emacs' fuzzy ido-mode and I'm very into that.

  • ... but, despite my vagueness, fzf tells me exactly what directory I've selected before I make the jump - some of the others rely on taking a leap of faith - 'please jump to a directory that looks a bit like <pattern>' It's a bit un-nerving.

  • Alt-C is so cool - I can be halfway through typing a command, realise I'm in the wrong directory, do Alt-C to fix that and go on to complete my command. Perhaps it's just the cuteness of the feature (which comes from fzf) rather than the practicality ... but I'm sure I'll use it one day!!

  • I don't have to think about it - "so I changed directory, should I bookmark it or not?" or more likely: "blast! I wish I'd remembered to bookmark that directory"

  • it's small and simple

  • it's my own bike shed and I think it should be red :-)

As I mentioned, each to his own but thanks for all the suggestions, comments and upvotes.

Find elsewhere
🌐
TurtleBytes Suite
turtlebytes.com › blog › linux-z-command-is-a-must-have-terminal-tool
Linux 'z' command is a must have terminal tool - TurtleBytes
January 12, 2026 - Instead of typing long paths or relying on tab completion, z learns the directories you visit and lets you jump to them using short, partial names. Once you use it, going back to plain cd feels painfully slow.
Top answer
1 of 3
66

If you have setopt AUTO_PUSHD in your .zshrc then cd will automatically do a pushd of each directory you change to. Taking the example from ZyX:

$ setopt AUTO_PUSHD
$ mkdir -p 1/2/3/4
$ cd 1
$ cd 2
$ cd 3
$ cd 4

You can see a list of the directories using dirs:

$ dirs -v
0    ~/1/2/3/4
1    ~/1/2/3
2    ~/1/2
3    ~/1
4    ~

To be able to tab complete the list you can use the + and - arguments with cd (<TAB> meaning you hit the tab key):

$ cd +<TAB>
1 -- ~/1/2/3
2 -- ~/1/2
3 -- ~/1
4 -- ~

Or the reverse:

$ cd -<TAB>
0 -- ~
1 -- ~/1
2 -- ~/1/2
3 -- ~/1/2/3

Then just select the number to go to that directory:

$ cd +2
$ pwd
~/1/2

Tab Complete Directories

I always forget the magic sequence to do the following so I updated the answer to explain this part.

The + and - will only take you to the directory, you can't tab complete the path in the stack (i.e. cd -2/<TAB> gives you nothing). To make this work, you can use a tilde (~).

Make some directories in 3 to make this example better.

$ mkdir 3/foo 3/bar 3/baz

Then find the directory in the stack.

$ cd ~+<TAB>
1 -- ~/1/2/3/4
2 -- ~/1/2/3
3 -- ~/1
4 -- ~

Then use tab completion on an entry.

$ cd ~+2/<TAB>
4/    bar/  baz/  foo/
2 of 3
8

If you use pushd instead of cd, then you can list directories with dirs and cd to old directory with popd. You can also set autopush option to get cd behave much like pushd -q. Here is an example:

setopt pushdsilent # Omit printing directory stack
setopt autopush    # Make cd push directories onto stack
setopt pushdminus  # Invert meanings of +N and -N arguments to pushd
mkdir -p 1/2/3/4
cd 1
cd 2
cd 3
cd 4
popd     # Go to previous directory (3) and remove it from directory stack
pushd -  # Go to previous directory (4)
pushd -2 # Go 2 directories back the directory stack (2)

Note that pushd does not remove anything from the directory stack, it only rotates it. See man zshbuiltins for more details.

🌐
ComputingForGeeks
computingforgeeks.com › home › using zoxide – smarter cd command for linux/macos
Using zoxide - smarter cd command for Linux/macOS [Guide]
April 2, 2024 - Using zoxide really helps when navigating between Linux/macOS. This is a shell plugin that can help improve productivity when working at the shell. The zoxide plugin is a replacement for the common cdcommand inspired by z and z.lua. It simplifies the task by keeping track of frequently visited directories using a ranking algorithm to navigate to the best match.
🌐
Mskelton
mskelton.dev › bytes › zoxide-a-smarter-cd-command
Zoxide, A Smarter cd Command - Mark Skelton
March 23, 2024 - With that in place, we can now use the z command as an alternative to the cd command. The z command works exactly like cd but with some additional features.
🌐
TecMint
tecmint.com › home › linux commands › stop using only cd: learn pushd, popd, and zoxide in linux
How to Use cd, pushd, popd, and zoxide in Linux
November 19, 2025 - sudo apt install zoxide eval "$(zoxide init bash)" Once it’s set up, you can jump to directories using only tiny fragments of their names, which takes you to whichever directory named “project” (or similar) you visit the most. ... The cd command is more than just a basic navigation tool, it’s a built-in part of the shell itself.
🌐
LinuxLinks
linuxlinks.com › home › z – jump around the filesystem
z - jump around the filesystem - LinuxLinks
October 14, 2023 - z is a shell script that maintains a jump-list of the directories you actually use. It tracks your most used directories, based on 'frecency'.
🌐
Arch Linux Man Pages
man.archlinux.org › man › zoxide.1.en
zoxide(1) — Arch manual pages
# 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)
🌐
Linode
linode.com › docs › guides › how-to-use-zoxide
How to Install and Use zoxide on Linux | Linode Docs
June 12, 2021 - zoxide is a fast and smart alternative to the cd command. Built on Rust, zoxide outperforms many similar commands, and its directory ranking algorithm helps you navigate quick. Learn more about zoxide in this guide, including how to install ...
🌐
Reddit
reddit.com › r/rust › zoxide: a smarter cd command, inspired by z and autojump, that remembers visited directories and allows you to jump directly to them
r/rust on Reddit: zoxide: a smarter cd command, inspired by z and autojump, that remembers visited directories and allows you to jump directly to them
September 17, 2024 - zoxide v0.8.0, a smarter cd command for your terminal · r/linux • · github · upvotes · · comments · Zoxide on ZSH with other Z tools · r/linuxmemes • · upvotes · · comments · Rust on z/OS · r/rust • · upvotes · · comments · Introducing zoxide, a replacement for cd that learns your habits ·
🌐
Command Line
commandinline.com › home › commandline › zoxide tutorial: smarter cd command for linux and mac users
zoxide Tutorial: Smarter cd Command for Linux and Mac Users | Command in Line
March 27, 2026 - Jump to any directory in two keystrokes with zoxide, the frecency-based cd replacement that learns where you go and gets you there instantly on Linux.
🌐
GitHub
github.com › agkozak › zsh-z
GitHub - agkozak/zsh-z: Jump quickly to directories that you have visited "frecently." A native Zsh port of z.sh with added features. · GitHub
If you try z foo, and foo is not in the database but ${PWD}/foo is a valid directory, Zsh-z will cd to it.
Starred by 2.4K users
Forked by 79 users
Languages   Shell