简体   繁体   中英

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

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

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

cd ..会让你恢复1级。

for windows, you can open up the file explorer copy path then in your command prompt type "cd" then paste path. Your command prompt should now default to that path. (you can also type the entire path)

cd C:\Users\username\Documents\Folder

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM