doc: add section about directory history / stack

This PR also adds "See Also" section in the related commands.
This commit is contained in:
Delapouite
2020-04-04 13:01:53 +02:00
committed by Fabian Homborg
parent d2cc59dc73
commit 8d20748f4a
10 changed files with 90 additions and 39 deletions

View File

@@ -13,7 +13,7 @@ Synopsis
Description
-----------
The ``pushd`` function adds ``DIRECTORY`` to the top of the directory stack and makes it the current working directory. :ref:`popd <cmd-popd>` will pop it off and return to the original directory.
The ``pushd`` function adds ``DIRECTORY`` to the top of the :ref:`directory stack <directory-stack>` and makes it the current working directory. :ref:`popd <cmd-popd>` will pop it off and return to the original directory.
Without arguments, it exchanges the top two directories in the stack.
@@ -21,10 +21,6 @@ Without arguments, it exchanges the top two directories in the stack.
``pushd -NUMBER`` rotates clockwise i.e. top to bottom.
See also :ref:`dirs <cmd-dirs>` to print the stack and ``dirs -c`` to clear it.
You may be interested in the :ref:`cdh <cmd-cdh>` command which provides a more intuitive way to navigate to recently visited directories.
Example
-------
@@ -49,3 +45,9 @@ Example
popd
# Working directory is now /usr/src/fish-shell
# Directory stack contains /usr/src/fish-shell /tmp
See Also
--------
- the :ref:`dirs <cmd-dirs>` command to print the directory stack
- the :ref:`cdh <cmd-cdh>` command which provides a more intuitive way to navigate to recently visited directories.