DEV Community

Discussion on: Get to Know the Command Line: Basic Commands

Collapse
 
bennypowers profile image
Benny Powers 🇮🇱🇨🇦

Great intro, I will definitely share this when asked.

Now if you want to go back to the directory you were in before ~/Development, you can use the command cd ... This command navigates up one directory.

TIL you can cd - to go back

cd Documents
pwd 
/Users/bennyp/Documents
cd
pwd
/Users/bennyp
cd ..
pwd
/Users

cd
cd Documents
pwd 
/Users/bennyp/Documents
cd
pwd
/Users/bennyp
cd -
pwd
/Users/bennyp/Documents
Collapse
 
torianne02 profile image
Tori Crawford

I had no idea this existed! This is awesome. Thank you for sharing.

Collapse
 
bennypowers profile image
Benny Powers 🇮🇱🇨🇦

Yeah I literally looked it up today.

There's pushd and popd also, but I wanted something that works like the back button even if I hadnt pushed.

Google brought me to unix.stackexchange.com/questions/8...