Search

Top Posts

Comments

  • David: thanks! And Hey I wasn’t calling you a liar just that the image may have been a fake and i said that i...
  • Dagaza: Thanks for the post, itunes also has an option to “Show Exact Duplicates” meaning you don’t...
  • maria Nicolaou: I have a Mac Os X version 10.5.8 and I was wondering if I can change my keyboard to a light one!
  • Mike: Holy cow, I want that! I have 3 monitors and it has greatly increased my productivity, I think it is an...
  • Zachary Waldowski: The Nvidia 9400M, which is on anything current but the high-end MacBook Pros, high-end iMacs, and...

Categories

Recent Posts


Go back to the previous directory via command line

It’s easy to accidentally change directories to something you weren’t intending to (say, accidentally hitting cd and returning home and losing your place in a complicated directory structure), but thankfully there’s a command that will immediately take you back to the previous directory:

cd -

It’s that simple, cd – will take you to the directory you were in prior to the PWD, and it will print out the prior directory before you so you will know you’re in the right place. This is very useful if you are working in two different directories and you want to quickly go back and forth between them, just keep typing cd – and you will keep switching between the two directories!

mac terminal icon This command line tip works in every variant of Unix I’ve used, so whether you’re in the Mac OS X command line or Linux, you should be covered.

Posted by: Bill Ellis

Share

Save big on Mac Deals from Amazon.com

Comments:

Comments: 1

Comment from Murphy
Time: February 10, 2010, 11:45 am

Just twittered this. Good one !

Write a comment






February 9th, 2010