I was wondering is there a command to return to the origin dir? For example I am deep in a folder tree and I want to pop back to where I started(my starting dir) without typing cd ../../..and so on.
Asked
Active
Viewed 69 times
0
-
4take a look at `pushd /?` and `popd /?`. – Stephan Sep 28 '20 at 13:03
-
It is also possible to use `setlocal` and `endlocal`. But `setlocal` does more than pushing only current directory on stack changed later with one or more `cd` and restore this directory from stack with `endlocal`. Read [this answer](https://stackoverflow.com/a/38676582/3074564) for details about the commands __SETLOCAL__ and __ENDLOCAL__. – Mofi Sep 28 '20 at 17:27