Even though this may come off as a clickbait title, I’m honestly telling you that this tool will save you lots of time typing in the terminal.
Tell me, how many times you did something like this:
mkdir testProject
cd testProject
mkdir app
cd app
mkdir config
mkdir js
mkdir css
cd js
mkdir vendor
cd vendor
cd ../../../
Let’s assume that you did all that on the ~/Desktop
folder; then you’re currently at the ~/Desktop/testProject/
folder.
Now, say you want to go back to the vendor
folder to add some other files/folders (or do some other stuff). Naturally, you would write cd app/js/vendor
.
What if I tell you that you could achieve the same this by typing something like z vend
?
Enter the Z tool. This simple script allows you to do just that – move to some folder without having to type the whole path in.
Just imagine, how many times you found yourself going through the terminal and changing directories and then telling yourself “Wouldn’t it be nice if I could just go back to that directory by just clicking on it (as you can in any GUI tool)?”. Well, now you can.
This cool tool was presented to me by my coworker Shawn Milochik, and I’m using it ever since. Here’s his YouTube video which will show you how to install and run this tool in under 3 minutes.
For the sake of brevity, here are the installation steps:
- download the z.sh to your local folder (for example
/Users/nikola/CoolScripts/z.sh
) - source it in your
.bash_profile
or.zshrc
config file by adding this line:source /Users/nikola/CoolScripts/z.sh
- start a new terminal window and make good use of Z
Hope this helps you and saves you some typing time as it does for me ?
This tool will save you tons of typing in Terminal – thanks to @ShawnMilo for showing it to me https://t.co/XPEegWPJRq
— Nikola Brežnjak (@HitmanHR) May 8, 2017