Sadly, I only learned about this last year by stumbling upon it randomly on the internet. I use it so infrequently that I always forget what it is by the time I need it again.
How do you change to your previous directory?
bashcd-commandshell
Sadly, I only learned about this last year by stumbling upon it randomly on the internet. I use it so infrequently that I always forget what it is by the time I need it again.
How do you change to your previous directory?
Best Answer
The shortcut is
-
Try
cd -
If you want to use this in your prompt, you have to refer to it with
~-
.See the example: