Pushd / popd


#1

Can someone tell me I am understanding pushd/popd correctly? pushd/ popd are basically bookmarking/remembering the directory/folder you were working in?

Just a bit confused. Why use these commands over cd and then using pwd to know where you are?


#2

pushd and popd use a stack, so you can push your current directory onto a stack, move to a completely different directory far removed from the directory you were in and then pop the directory you were in from the stack to move back to it. With cd you’d have to type in a long directory command to change to a folder many directories away.


#3

Ok, thank you! :slight_smile: