Using Zoxide to superpower your `cd` command in Linux

mbvissers.eth
Quick Programming
Published in
2 min readMar 2, 2024

--

I never thought about replacing cd , but I’m glad I did.

Example of Zoxide usage

So, I’ve never though I would be replacing a default Linux command with a tool someone wrote in Rust. But here we are.

What is Zoxide?

Zoxide is a smarter cd command created by ajeetdsouza. It helps you browse to your regularly used directories in such a way that you don’t need to remember the whole path every time you need to get to it.

How does it work?

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. It will register how often you browse to a folder and what the last time you used the folder was.

With this information, it can help you get to folders quicker. For example the image above I’ve given as an example.

I’m starting to write articles in Markdown (might use ASCIIDoc soon though), and I often have to get to my articles repo which is located a few directories deep in my file system.

But with Zoxide I only have to write

$ z articles

Which is crazy.

More

But of course, having to kill all your muscle memory can be a bit annoying. That’s why I simply have

alias cd="z"

in my .zshrc . This way I will always use Zoxide. Because it also works the same as the regular cd command, this doesn’t do any harm, and it will only use its fancy features if you know how they work.

Another command shipped with Zoxide is zi . With this you can quickly view the latest directories you went to with z and see the ‘weight’ Zoxide has assigned to each.

Conclusion

Do you like the way that these little projects try to improve decades old tools? Do you think Zoxide or something similar might one day be merged in Arch or Ubuntu by default? Let me know!

Thank you so much for reading and have an excellent day.

I am not a part of the Medium partner program anymore so I don’t earn anything from this. Give me a follow and help me spread knowledge for free.

Follow me on Twitter (X) and here on Medium to keep up with me and my projects.

--

--

mbvissers.eth
Quick Programming

I occasionally write about programming. Follow me on Twitter @0xmbvissers