Skip navigation

I was always worried about having to go up in a unix directory tree with cd ../. Then I was introduced to this project at work where I noticed that I was doing so much cd-ing around. Sometimes I went so deep in the directory tree I had this scary feeling inside that I’d get lost in a dark pit (true story).

I wanted a better way to do it. So I did what anyone these days would do. But the best the internet could offer were using pusd/popd, aliasing multiple ../s to ..n and using CDPATH. None of these felt natural enough.

So on one boring evening at work I started to scratch my own itch. I started to do it in python but I ended up in a simpler, much better solution. A function for my bashrc.

I call it za because …

cd to za

cd to za (image: markhillary flickr)

you can use za to jumpback any number of directories up to your $HOME directory. Just put the following function in your .bashrc

za 2 #will jump 2 directories up
za #will jump one directory up

Just see it in action.

za-in-action

za in action

Hope you find it useful.

PS: My blog marked 6 years to yesterday (8th August 2012). I’m out of (a year?) long block with this post :)

Update (07-03-2014): There’s a Fish Shell port of Za now.

3 Comments

  1. that’s very cool. happy blogiversary :)

  2. Hi, can u show me how to watch(stream live) swarnavahini on line tv? i have flash installed.. and i can watch evryother sri lankan tv on line but swarnavahini. pls try yourself on linux and let me know how to. i try on linux not windows. tnx

  3. Pretty cool! This should be made an in-build command.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,048 other followers

%d bloggers like this: