I remember there was a way to execute the cd
command, automatically returning to the previous directory (without an explicit cd ...
).
Is it possible?
If you just want to go back to the last directory, you can use cd -
.
If you need more places to go back to, try pushd <dir>
(instead of cd <dir>
) and then you can go back with popd
.
Found! I can execute it as a sub-shell.
A command list embedded between parentheses runs as a subshell.
SOURCE: http://tldp.org/LDP/abs/html/subshells.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With