Name

dirs

Synopsis

dirs [-clpv] [+n] [-n]

Print the directory stack, which is managed with pushd and popd.

Options

+n

Print the nth entry from the left; first entry is zero.

-n

Print the nth entry from the right; first entry is zero.

-c

Remove all entries from (clear) the directory stack.

-l

Produce a longer listing, one that does not replace $HOME with ~.

-p

Print the directory stack, one entry per line.

-v

Print the directory stack, one entry per line, with each entry preceded by its index in the stack.

Get bash Quick Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.