Unix/Linux trick: ‘cd’ back to the previous directory

You know when you’re in a very “deep” directory, such as /usr/local/src/this/that/thatother, and you type “cd” and press enter by mistake ((happens a lot when you thin…

Source: Unix/Linux trick: ‘cd’ back to the previous directory

Shortly, is as simple as «cd -». Since true knowledge lies in manpages, here’s the right quote:

An argument of – is equivalent to $OLDPWD.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.