Admin-Ahead Community

Linux => General Linux => Topic started by: sajay on December 01, 2013, 08:41:11 pm

Title: "cd -" Command
Post by: sajay on December 01, 2013, 08:41:11 pm
A useful shortcut with cd is to just type cd - to go to the previous directory i.e the directory or path which you where in before not the one

For Example:

Quote
root@backup02 [/home/scp]# pwd
/home/scp
root@backup02 [/home/scp]# cd /home/test/
root@backup02 [/home/test]# pwd
/home/test
root@backup02 [/home/test]# cd -
/home/scp
root@backup02 [/home/scp]# pwd
/home/scp
root@backup02 [/home/scp]# cd -
/home/test
root@backup02 [/home/test]# pwd
/home/test
root@backup02 [/home/test]#