Sim, existe. man bash vai levar você para
OLDPWD The previous working directory as set by the cd command.
A variável de ambiente em $PWD tem o diretório de trabalho atual. Existe uma variável que contém o diretório anterior? Se não houver, como pode ser criado?
Acho que isso pode ser útil.
Sim, existe. man bash vai levar você para
OLDPWD The previous working directory as set by the cd command.