Are you tired of running multiple cd commands and ls commands while searching files and directories on your system? cdir is a cool and easy-to-use command-line utility that provides a pleasant way to navigate the bash shell and search for files. It is written in Python and uses the curses module.
Let’s briefly have an overview of some of the features it provides:
Functionalities of cdir Command
- Supports the use of arrow keys when navigating between directories and searching for files.
- Searches files by simply typing the name of the file within a directory.
- Supports Bash Shell, Windows Powershell & Command Prompt.
Here is the live preview of cdir command in action.
Installation of CDIR on Linux
To install CDIR use pip, which is Python’s package manager as shown. For this case, I’m using pip3 since it’s installed by default alongside Python3.
$ pip3 install cdir --user
Once installed, append an alias to the .bashrc file as shown:
$ echo "alias cdir='source cdir.sh'" >> ~/.bashrc
And finally, reload the .bashrc file.
$ source ~/.bashrc
To start searching files, run the cdir command:
This will display a list of folders in your current working directory and hidden files.
To search files, use the arrow up and down keys to navigate between directories. In the example below, all files under the Downloads folder have been displaced.
To quit using cdir tool, simply press the
F11 key on your keyboard. And that’s just about it. Give it a test run and let us know how it went.