pushd and popd

  • Both are shell commands
  • The pushd command 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>
  • popd can be used to return back to the previous directory that is on top of the stack.
    • syntax: popd
  • examples:
root@e154689b500f:/home# pushd /usr/bin
/usr/bin /home
root@e154689b500f:/usr/bin# popd
/home
root@e154689b500f:/home#