2019-03-31 17:05:09 +08:00
.. _cmd-prevd:
2018-12-17 09:39:33 +08:00
prevd - move backward through directory history
2019-01-03 12:10:47 +08:00
===============================================
2018-12-17 09:39:33 +08:00
2018-12-18 09:58:24 +08:00
Synopsis
--------
2018-12-17 05:08:41 +08:00
2019-09-17 17:59:04 +08:00
::
2018-12-18 09:58:24 +08:00
2019-09-17 17:59:04 +08:00
prevd [ -l | --list ] [POS]
2018-12-17 05:08:41 +08:00
2018-12-19 10:44:30 +08:00
Description
2019-01-03 12:10:47 +08:00
-----------
2018-12-17 05:08:41 +08:00
2020-04-04 19:01:53 +08:00
`` prevd `` moves backwards `` POS `` positions in the :ref: `history of visited directories <directory-history>` ; if the beginning of the history has been hit, a warning is printed.
2018-12-17 05:08:41 +08:00
2018-12-20 04:02:45 +08:00
If the `` -l `` or `` --list `` flag is specified, the current history is also displayed.
2018-12-17 05:08:41 +08:00
2018-12-20 04:02:45 +08:00
Note that the `` cd `` command limits directory history to the 25 most recently visited directories. The history is stored in the `` $dirprev `` and `` $dirnext `` variables which this command manipulates.
2018-12-17 05:08:41 +08:00
2018-12-19 10:44:30 +08:00
Example
2019-01-03 12:10:47 +08:00
-------
2018-12-17 05:08:41 +08:00
2018-12-19 11:14:04 +08:00
::
cd /usr/src
# Working directory is now /usr/src
2019-09-17 16:50:52 +08:00
2018-12-19 11:14:04 +08:00
cd /usr/src/fish-shell
# Working directory is now /usr/src/fish-shell
2019-09-17 16:50:52 +08:00
2018-12-19 11:14:04 +08:00
prevd
# Working directory is now /usr/src
2019-09-17 16:50:52 +08:00
2018-12-19 11:14:04 +08:00
nextd
# Working directory is now /usr/src/fish-shell
2018-12-17 05:08:41 +08:00
2020-04-04 19:01:53 +08:00
See Also
--------
- the :ref: `cdh <cmd-cdh>` command to display a prompt to quickly navigate the history
- the :ref: `dirh <cmd-dirh>` command to print the directory history
- the :ref: `nextd <cmd-nextd>` command to move forward