re: BASH tricks: The dir stack. VIEW POST


I've always either used cd - as @fluffy pointed out or more often I used subshells (if I'm not mistaken about the name) which is simply used through parenthesis.
For instance: (cd /etc/mysql && exec ls)
but the one you have taught here is even cooler than the ones I've been using and I didn't know it. Thanks!


Ah yeah subshells are great. I mostly use them to gather up the output from a bunch of commands but they’re also great for encapsulating environment. Note that you can also use ;s in them too!

code of conduct - report abuse