Categories
Hosting Tips & Deals Linux Server Administration Tips

Linux: Change Directory or CD to the Previous Directory / Last Path

cd is the command in Linux to change the current working directory. While you can change to your home directory by cd ~, you can change to the previous directory or last directory you were in by:

cd -

Which would come very handy when you are working across multiple directories back and forth. To change to the second last directory in the path history, simply add a slash:

cd --

By Yang Yang

Hello, I'm Yang. I build online businesses that please people. Want to join in and post some useful articles on Kavoir.com? Shoot me a message.