snippetbashTip
popd — Remove a directory placed on the directory stack via the `pushd` shell built-in. See also: `pushd`,
Viewed 0 times
directorythecommandremoveplacedclipopd
Problem
How to use the
popd command: Remove a directory placed on the directory stack via the pushd shell built-in. See also: pushd, dirs. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-popd>.Solution
popd — Remove a directory placed on the directory stack via the pushd shell built-in. See also: pushd, dirs. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-popd>.Remove the top directory from the stack and cd to it:
popdRemove the Nth directory (starting from zero to the left from the list printed with
dirs):popd +NRemove the Nth directory (starting from zero to the right from the list printed with
dirs):popd -NRemove the 1st directory (starting from zero to the left from the list printed with
dirs):popd -nCode Snippets
Remove the top directory from the stack and cd to it
popdRemove the Nth directory (starting from zero to the left from the list printed with `dirs`)
popd +NRemove the Nth directory (starting from zero to the right from the list printed with `dirs`)
popd -NRemove the 1st directory (starting from zero to the left from the list printed with `dirs`)
popd -nContext
tldr-pages: common/popd
Revisions (0)
No revisions yet.