cd - can goto last directory that you just leave,
$OLDPWD. This only support one directory.
pushd / popd / dirs works on multiple directories, as a directory stack:
pushd [dir1] # add dir to stack popd [dir1] # pop dir from stack dirs # list stack dirs -c # cleanup stack
Was this page helpful?