Manipulating the Directory Stack

Using a shell , you can store a list of directories you are working with, enabling you to move easily among them. The list is referred to as a stack. You can think of it as a stack of dinner plates; you typically add plates to and remove plates from the top of the stack: a first-in last-out, or FILO, stack.

dirs: Displays the Stack

The dirs builtin displays the contents of the directory stack. If you call dirs when the directory stack is empty, it displays the name of the working directory:

$ dirs ~/literature  ...

Get A Practical Guide to Red Hat® Linux® 8 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.