In this article, you will learn about the cdir command-line tool, an alternative to cd command on Linux/Unix-like operating systems. You will also learn how to install and setup the cdir tool in your system.

The cdir is a command-line tool, allowing the user a faster way to navigate folders and browse files in Windows and Linux shells. It offers many features.

  • Use arrow keys to browse through files/folders.
  • Modern and easy-to-use search functionality for folders.
  • Supports Linux shell and Window’s PowerShell.
  • Easy to install and setup with pip.

Also checkout: Most essential apps for every Linux user | 2020

Installing the cdir tool on Linux

the cdir tool is available through Python’s package manager (pip). In order to install it, you must have python3 and python3-pip installed in your system.

These two packages are already available in the official repository of your Linux distribution. So simply use the installation command to install them.

For Debian/Ubuntu and their derivatives.

sudo apt install python3 python3-pip

For RPM based distributions like Fedora, CentOS, RedHat

sudo dnf install python3 python3-pip

Now you can use the pip (package manager for Python) to install cdir tool.

pip install cdir

You should get similar output when you will execute the above command.

installing cdir on linux

Now we have to set up the environment path so that the shell can know where the cdir tool is. For this, we have to use the highlighted path in the .bashrc file.

nano ~/.bashrc

Paste these two lines at the end of the file. (use Ctrl+Shift+v)

alias cdir='source /home/your-user-name/.local/bin/'
alias cdir_cli='/home/your-user-name/.local/bin/cdir_cli'

After that save the file and quit from the nano editor. (Save: Ctrl+O – Exit: Ctrl+X)

Use this command to let the shell know that you have made some changes or simply restart the terminal emulator.

source ~/.bashrc  

To use the tool use the cdir command.

Watch Video guide on YouTube

Additionally, You can also watch a step-by-step video guide on YouTube to get a better understanding of it.


That’s it about cdir on Linux. Let me know what you think about it in the comments and subscribe to the LinuxH2O Youtube channel. Till then, keep enjoying Linux.