Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I am currently in /downloads directory. Before I was in /var/www directory. How can I return back to the old directory in terminal? I do not want to execute cd /var/www

I need a simple command to change to old directory.

share|improve this question

marked as duplicate by fossfreedom Mar 20 at 13:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

with bash you can use cd - to go to the old directory also know as OLDPWD

share|improve this answer

cd - : return back to old directory

example:

pwd 

gives

/home/julia/Downloads

Now

cd -

then

pwd

gives

/var/www

cd .. : return back to parent directory

cd ~: go to home directory

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.