dirs
Display or manipulate the directory stack. tldr-pages
On several platforms
Several platforms
Display or manipulate the directory stack. The directory stack is a list of recently visited directories that can be manipulated with the pushd and popd commands.
Display the directory stack with a space between each entry
dirsIdentifyDisplay the directory stack with one entry per line
dirs -pIdentifyDisplay a numbered list of entries in the directory stack
dirs -vIdentifyDisplay the directory stack without the tilde-prefix (~)
dirs -lIdentifyDisplay only the nth entry in the directory stack, starting at 0 (Bash only)
dirs +nIdentifyDisplay only the nth entry in the directory stack from the last, starting at 0 (Bash only)
dirs -nIdentifyClear the directory stack
dirs -cIdentify