Bash - dirs (list of remembered directories)

1 - About

Stack/list of remembered directories.

You can change of directories and return to the directory from which you came.

3 - Syntax


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

  • Without options, displays the list of currently remembered directories.
  • +n Displays the nth entry counting from the left of the list shown by dirs when invoked without options, starting with zero.
  • -n Displays the nth entry counting from the right of the list shown by dirs when invoked without options, starting with zero.
  • -c Clears the directory stack by deleting all of the entries.
  • -l Produces a longer listing; the default listing format uses a tilde to denote the home directory.
  • -p Print the directory stack with one entry per line.
  • -v Print the directory stack with one entry per line, prefixing each entry with its index in the stack.

4 - Management

4.1 - Return value

The return value is 0 unless an invalid option is supplied or n indexes beyond the end of the directory stack.

4.2 - Display

The default display is on a single line with directory names separated by spaces.


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap