First i did pwd
, it says:
/home/user
I changed my directory using :
cd /Italic/Food/Places
Now, I want to go back to original directory: /home/user
. How can I do this?
command line
First i did pwd
, it says:
/home/user
I changed my directory using :
cd /Italic/Food/Places
Now, I want to go back to original directory: /home/user
. How can I do this?
Best Answer
To
cd
to the previous directory, you can use one of the following commands in bash:To
cd
to your home directory, use one of:If you want to undo multiple
cd
s,cd
can't help you. You'll have to use thepushd
andpopd
commands. Instead ofcd foo/bar
, doThen you can use the
popd
command to undo as many times as you have usedpushd
.Example:
Also see: