How did not know that #bash/#zsh automatically keeps track of the $OLDPWD and even offers a shortcut `~-`?
`cd ~-`
Shell variable ~-
After writing the previous post, I poked around in the bash shell documentation and found a handy feature I'd never seen before, the shortcut ~-. I frequently use the command cd - to return to the previous working directory, but didn't know about ~- as a shotrcut for the shell variable $OLDPWD which contains the