Take the 2-minute tour ×

Possible Duplicate:
Can windows command line support Linux “cd -”?

Under Linux, I can use cd - to return to the last directory. How can I do that on Windows?

share|improve this question
Duplicate of this question: superuser.com/questions/81755/… –  Snark Dec 18 '09 at 10:12
add comment

marked as duplicate by Snark, innaM, ChrisF, harrymc, Phoshi Dec 18 '09 at 11:12


2 Answers

up vote 3 down vote accepted

you can use the pushd and popd commands.

pushd will change directory from location a to location b popd will change directory back to directory a

share|improve this answer
add comment

Cmd.exe is an emulation layer for the old MS-DOS, commands are the same :

  1. One step backward = cd..
  2. All Backward = cd /

For the others look at some Ms-Dos table around the web

share|improve this answer
This is not what cd - does. If one is in /a/b/c/d then cd's to /a/e/f, cd - as a command returns you to /a/b/c/d, whereas cd .. moves you to /a/e and cd / moves you to /. –  Neal Dec 18 '09 at 15:18
You are right i've misunderstanded the question. (What poor figure!) :-( –  Акула Dec 18 '09 at 15:39
add comment
