From a POSIX shell `$OLDPWD` holds the name of the previous working directory:
cd /tmp
echo You are here: $PWD
echo You were here: $OLDPWD
cd $OLDPWD

#Unix #Linux #Shell #cd

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.