DEV Community

Cover image for How to install Zoxide on Linux
Kelvin Hey
Kelvin Hey

Posted on

How to install Zoxide on Linux

The cd (change directory) command is fundamental in the Linux terminal and other Unix-based operating systems. This command is one of the first you learn when using the terminal, as it allows you to navigate between directories, making it an essential part of interacting with the file system.

While cd enables efficient navigation, there are tools that can make this experience even smoother, such as Zoxide, an open-source tool that works like "a smarter cd command." Zoxide has the ability to remember which directories you've accessed frequently, allowing you to jump to them with just a few keystrokes.

By using Zoxide, you can save time and effort when navigating between directories, making the navigation much more intuitive. With Zoxide, your productivity in the terminal can significantly increase, providing a more fluid and efficient navigation experience.

In this tutorial, you will learn how to install and use Zoxide.

🎥 Check out the video:

Installing Zoxide

You can install Zoxide by using the installation binary or a package manager. If you are using Debian, run:

sudo apt install Zoxide 
Enter fullscreen mode Exit fullscreen mode

Image description

👉 Zoxide Github Page: https://github.com/ajeetdsouza/zoxide

How to Setup Zoxide on your shell

After installing, you need to add Zoxide to your shell to start using it.

If you are using Zsh, this line must be added to the end of your shell config file.

eval "$(zoxide init zsh)"
Enter fullscreen mode Exit fullscreen mode

To edit the Zsh configuration file run:

nano .zshrc
Enter fullscreen mode Exit fullscreen mode

Image description

If you are using Bash, you need to add this line to the end of your shell config file.

eval "$(zoxide init bash)"
Enter fullscreen mode Exit fullscreen mode

To edit the Bash configuration file run:

nano .bashrc
Enter fullscreen mode Exit fullscreen mode

How to use Zoxide

To start using Zoxide, navigate to some directories as you would with cd, but use the z command instead. After that, Zoxide will remember the directories you visit, allowing you to access them quickly.

For example, you can access some directories using the z command. After that, you can quickly access any of them by simply typing the name of the last directory in the path, such as themes from /usr/share/themes.

# change to a path using z
z /usr/share/themes

# zoxide will remember the path
z themes
Enter fullscreen mode Exit fullscreen mode
# change to a path using z
z /etc/mysql
z /etc/ssh
z /usr/local/share/fonts

# quickly access the path
z mysql
z ssh
z fonts
Enter fullscreen mode Exit fullscreen mode

I hope this article has been helpful in improving your experience using the Linux terminal.

Top comments (0)