The environmental variable in $PWD has the current working directory. Is there a variable that contains the previous directory? If there is not, how might one be created?
I think this could be useful.
1 Answer
Yes, there is. man bash will lead you to
OLDPWD The previous working directory as set by the cd command. 7