pushd and popd
I don’t know how I’ve gone this long without this pair of commands. Use pushd dir to stick a directory on the dirs stack and popd to take the last off. Where is this useful? Imagine working in /var/www/logs and now you need to peek over at /home/user and while there you pop into some other directory. Well now cd - doesn’t work and you’re left typing the full path back to the logs you were reviewing. BUT WAIT! Had you pushd logs you could simply popd and be back REGARDLESS of how far you’d traveled.
Very useful magic indeed.
About the author
Brooks Garrett is a dedicated technologist who specializes in information security. Brooks has spent over 10 years implementing security programs for both the public and private sector including some of the biggest names in the Fortune 500. When he's not managing risk in the corporate environment you can find him at the local firestation where he is a volunteer firefighter.