pushd and popd
- Both are shell commands
- The
pushdcommand is used to save the current directory into a stack and move to a new directory. If no directory is specified, pushd changes the directory to whatever is on the top of the stack.- syntax:
pushd <directory>
- syntax:
popdcan be used to return back to the previous directory that is on top of the stack.- syntax:
popd
- syntax:
- examples:
root@e154689b500f:/home# pushd /usr/bin
/usr/bin /home
root@e154689b500f:/usr/bin# popd
/home
root@e154689b500f:/home#