2016-02-10 17:36:38 +00:00
|
|
|
# dirs
|
|
|
|
|
2024-04-18 05:04:00 +01:00
|
|
|
> Display or manipulate the directory stack.
|
2016-02-10 17:36:38 +00:00
|
|
|
> The directory stack is a list of recently visited directories that can be manipulated with the `pushd` and `popd` commands.
|
2021-04-18 16:38:02 +01:00
|
|
|
> More information: <https://www.gnu.org/software/bash/manual/bash.html#Directory-Stack-Builtins>.
|
2016-02-10 17:36:38 +00:00
|
|
|
|
|
|
|
- Display the directory stack with a space between each entry:
|
|
|
|
|
|
|
|
`dirs`
|
|
|
|
|
|
|
|
- Display the directory stack with one entry per line:
|
|
|
|
|
|
|
|
`dirs -p`
|
|
|
|
|
|
|
|
- Display only the nth entry in the directory stack, starting at 0:
|
|
|
|
|
|
|
|
`dirs +{{N}}`
|
|
|
|
|
|
|
|
- Clear the directory stack:
|
|
|
|
|
|
|
|
`dirs -c`
|