Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 '14 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.

cd - : return back to old directory






cd -





cd .. : return back to parent directory

cd ~: go to home directory

share|improve this answer

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

share|improve this answer

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