Dev Tools S01E01 : Z – Jump around

EDIT : The install method on Zsh + Oh my ZSH updated to prevent z_dirs:2: no such file or directory: /home/$USER/.z . Thanks to GAD3R for his reply to my answer here.

Howdy people,

So I’m starting this new blog post series called Dev Tools on which i’ll be going through some tools that I find useful and that can make developer’s life easier. This first episode is going to be about a command line tool called Z – Jump around  or just z. I’m not sure but the name may refer to a bunny’s leg which is shaped as a Z .

A scared bunny escaping !

This command line tool records every directory accessed then keeps a list of the most recent/frequent (“frecent” is the word used by its creator) paths you’ve been on. The recorded paths can then be accessed by a relatively short command line. Let’s take a look on how it works.

Cool right ? And if you try to run it without any parameter, you’ll get the list of recorded directories, every record has a rank that determines its frequency.

For more advanced usage, you can check the README file.

How to install

Download the script wget https://raw.githubusercontent.com/rupa/z/master/z.sh

Using bash ?

  • Run printf "\n\n#initialize Z (https://github.com/rupa/z) \n. ~/z.sh \n\n" >> .bashrc
  • Reload the shell source ~/.bashrc

Using zsh (without Oh My Zsh) ?

  • run printf "\n\n#initialize Z (https://github.com/rupa/z) \n. ~/z.sh \n\n" >> .zshrc
  • Reload the shell source ~/.zshrc

Using zsh + Oh My Zsh ?

This is my personal favourite setup ! (learn how to get it up and running here).

All you need to do is add z to the plugins list in ~/.zshrc.

plugins=(
 git
 z
)

Download the z script to your home directory:

wget https://raw.githubusercontent.com/rupa/z/master/z.sh -O ~/.z

Then:

source ~/.zshrc

That’s it 🙂 hope this will make your life a bit easier and see you soon for the second episode.

 

Mohamed IBRIHEN

Junior Software Engineer, Tech Lover, Blogger, Technology intelligence, #Gamer, #SometimesBooksReader, #Geek. #music, speaks 4 languages.