Note that I learned how to use the convenient cd command
You can use cd -
to return to the previous directory.
$ pwd
/home/someuser
$ cd somewhere/to/work && pwd
/home/someuser/somewhere/to/work
$ cd -
/home/someuser
$ cd -
/home/someuser/somewhere/to/work
Useful when returning to the root directory of the original project after moving directories with npm scripts or CI/CD
$ cd path/to/child && [Do something] && cd -
Recommended Posts