Zoxide, A Smarter cd Command
I recently started using a tool called
Zoxide from a friend’s
recommendation and I must say, it’s pretty awesome. Zoxide is a smarter
cd command that tracks your most used directories and allows you to jump
to them with ease.
Installing Zoxide is a simple Brew command:
brew install zoxideThere is some shell setup required and since I use Fish, I had to add the
following to my ~/.config/fish/config.fish file:
zoxide init fish | sourceWith 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. For example, you can use z - to jump to the last
directory you were in, or z data to jump to the most used directory that
contains the word data.
Here are some examples:
# jumps to ~/dev/data-science
z ~/dev/data-science
# jumps to ~/dev
z -
# jumps to ~/dev/data-science
z dataI’d highly recommend checking it out yourself, it’s a great tool to have in your toolbox.