LinuxCommandLibrary

popd

TLDR

Pop directory from stack

$ popd
copy
Pop and go to Nth directory
$ popd +[N]
copy
Pop without changing directory
$ popd -n
copy
Show directory stack
$ dirs
copy

SYNOPSIS

popd [options] [+N|-N_]

DESCRIPTION

popd removes directories from the stack. Returns to previous directory.
The tool complements pushd. Manages directory history.
popd navigates directories.

PARAMETERS

+N

Remove Nth entry from left.
-N
Remove Nth entry from right.
-n
Suppress directory change.

CAVEATS

Shell built-in. Works with pushd and dirs.

HISTORY

popd is a shell built-in for directory stack management.

SEE ALSO

pushd(1), dirs(1), cd(1)

Copied to clipboard