Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I reverse the cd command in the Terminal on Mac OS X?

Tags:

terminal

macos

I am beginning to learn ruby and was following the instructions of one video to access the desktop through the -ls command in the terminal. Now, I would like to get out of the desktop in the terminal and don't know how. I know, I know I am a total noob... but can someone please help. Thanks. BTW the command I wrote was:

   my-iMac~ me$ cd Desktop/
   my-iMac:Desktop samuel$ ls
like image 954
SamYoungNY Avatar asked Feb 01 '12 16:02

SamYoungNY


2 Answers

Where would you like to go?

Go home: cd or cd ~
Go to the previous working directory: cd $OLDPWD
Go to parent of the current directory: cd ..
Go to any directory you want: cd /path/to/directory

like image 59
ughoavgfhw Avatar answered Nov 18 '22 00:11

ughoavgfhw


cd .. will take you back up 1 level.

like image 30
Scott Hunter Avatar answered Nov 18 '22 00:11

Scott Hunter