DEV Community

Cover image for If You are a Terminal User, You MUST try this tool!
Mammad Yahyayev
Mammad Yahyayev

Posted on

If You are a Terminal User, You MUST try this tool!

Hello folks. In today’s article, I want to share the tool that I can’t survive a day without it. Let’s not waste our time and dive deep into the topic.

Introduction

I bet as a terminal user you’ve dealing with the situation that you open multiple terminal to start your applications. If those application located in different places, then you have to manually change the current working directory to project’s directory.

Instead of manually going through each directory, you can type the name of the last directory on your terminal, and boom!. Now current working directory is your project’s directory.

The tool name is zoxide.

It remembers which directories you use most frequently, so you can “jump” to them in just a few keystrokes. zoxide works on all major shells.

zoxide written in Rust language.

Installation

zoxide is supported on Windows/Mac OS/Linux and there are multiple ways to install zoxide into your favorite terminal.

You can find all installations options in official GitHub repository.

Zoxide Use Cases

If you fully installed zoxide and type z in your terminal, then you will see nothing in your terminal window.

Move to Directories with One COMMAND

Imagine you want to move to following directory.

~/Desktop/learning/projects/python/data-science/pandas
Enter fullscreen mode Exit fullscreen mode

Changing current working directory to above path will usually take more than 5 seconds, it can take more if you half remembered the path or there are other directories.

With zoxide, you can move to pandas directory in just blink of an eye.

~/Desktop$ z pandas
~/Desktop/learning/projects/python/data-science/pandas$
Enter fullscreen mode Exit fullscreen mode

Important note here! If this is your first time to move pandas directory after zoxide installation, it might not work. Therefore you have to manually change directory once to make zoxide remember the path.

Same Directory Name in Different Case

zoxide tool is case insensitive in certain situations. For instance, you have directory called Desktop and you type Desktop or desktop both will redirect to the same directory.

However, if you have directories called Test and test, in this case, if you type Test, you will end up in Test directory.

Use Few Letters of Directory to Change Current Working Directory

Imagine this scenario: You are working in a microservice application that has similar naming pattern. For example,

~/Desktop/projects/microservice/banking/payment-ms
~/Desktop/projects/microservice/banking/user-ms
~/Desktop/projects/microservice/banking/notification-ms
~/Desktop/projects/microservice/banking/card-ms
Enter fullscreen mode Exit fullscreen mode

In above case, you don’t need to write the directory name as a whole. Just type pay or payment to move payment-ms directory, same is true for other directories as well.

How to Add Directory Manually to Zoxide

You can add directories manually to zoxide. Execute following command on your terminal.

~/Desktop$ zoxide add <directory-path>
Enter fullscreen mode Exit fullscreen mode

However, I don’t recommend this. Just use cd command once, and next time zoxide will remember the path.

More Operations

You can do more operations with zoxide:

  • limiting number of directory path in the zoxide database.
  • define aging algorithm to delete path from database after certain time.
  • exclude certain directories from zoxide database.

You can do more but above use cases is more than enough for everybody.

Third Party Integrations

You can install third party integrations to make zoxide more powerful.

References

Conclusion

This is the end of the article. Thanks for reading. If you find this article useful, follow for more.

I am open for any suggestions, you can reach me via LinkedIn.

See you soon in upcoming articles.

Top comments (10)

Collapse
 
ujjwall-r profile image
Ujjwal Raj • Edited
Collapse
 
mammadyahyayev profile image
Mammad Yahyayev

Great tool my friend!.

Thanks for sharing

Collapse
 
ujjwall-r profile image
Ujjwal Raj

Add star to the repo if you like it after using. We are inviting more C++ open source developers to contribute.

Collapse
 
mammadyahyayev profile image
Mammad Yahyayev • Edited

I added a star, thanks for your kind request, I wish to work on open source projects, unfortunately I don't know C++. Maybe you can give me suggestions to where to start to learn C++.

Thread Thread
 
ujjwall-r profile image
Ujjwal Raj

Thanks,
You can start with basics of cpp from any resource like : codewithharry.com/tutorial/cplusplus/

Important topics that would help: STL, Classes and Interfaces, OOPs

Thread Thread
 
mammadyahyayev profile image
Mammad Yahyayev

Thanks my friend

Collapse
 
perviz_yahyayev profile image
Perviz Yahyayev

Very usefull👏🏻👏🏻👏🏻👍🏻👍🏻👍🏻

Collapse
 
mammadyahyayev profile image
Mammad Yahyayev

I am pleased, you liked it. Thanks for your feedback

Collapse
 
hasan_zeynalov_52cc27aca9 profile image
hasan zeynalov

python better

Collapse
 
mammadyahyayev profile image
Mammad Yahyayev

Without a doubt Python is a great language.