up vote 1 down vote favorite
share [g+] share [fb]

In Linux we can use "cd -" to enter the previous directory, like:

/home/user: cd /a

/a: cd -

/home/user:

The - means the latest previous directory.

link|improve this question
1  
This belongs on SuperUser. – Asaph Dec 11 '09 at 5:55
Really useful to transfer to SU a post that was already answered in SO. – harrymc Dec 11 '09 at 6:58
feedback

migrated from stackoverflow.com Dec 11 '09 at 6:21

This question came from our site for professional and enthusiast programmers.

2 Answers

You can use pushd and popd:

c:\> pushd c:\windows
c:\Windows> popd
c:\>
link|improve this answer
you can use those on *nix systems too, and they're not limited to just "last directory". the windows versions also have some nifty sideeffects like auto-mounting network shares and such. – quack quixote Dec 11 '09 at 6:34
1  
Yes, but don't forget the popd after you pushd'd an UNC path, otherwise the temporary share will linger around :-) – Joey Dec 11 '09 at 7:00
feedback

Windows command-line by itself, no...

But, if needed / interested, you might want to try something like Cygwin or Msys, which will allow you to use a Linux-shell on Windows.

Not sure it's really what you want, but it might solve some or your problems.

(The other solution being to just... use Linux ^^ )

link|improve this answer
4  
+1 for "just use Linux". – Michael Aaron Safyan Dec 11 '09 at 6:12
feedback

Your Answer

 
or
required, but never shown

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