re: BASH tricks: The dir stack. VIEW POST

FULL DISCUSSION
 

You might also always want to secure your scripts, so that they exit on failure of changing the directory.

Different tools do different things; I'd advise against aliasing it to cd. The default behaviour is so fundamentally different and sometimes you don't necessary want to return to the directory where you have been before. You might be building up a stack that you don't need and not even want.

code of conduct - report abuse