2019-03-31 09:05:09 +00:00
.. _cmd-prevd:
2018-12-17 01:39:33 +00:00
prevd - move backward through directory history
2019-01-03 04:10:47 +00:00
===============================================
2018-12-17 01:39:33 +00:00
2018-12-18 01:58:24 +00:00
Synopsis
--------
2018-12-16 21:08:41 +00:00
prevd [ -l | --list ] [POS]
2018-12-18 01:58:24 +00:00
2018-12-16 21:08:41 +00:00
2018-12-19 02:44:30 +00:00
Description
2019-01-03 04:10:47 +00:00
-----------
2018-12-16 21:08:41 +00:00
2018-12-19 20:02:45 +00:00
`` prevd `` moves backwards `` POS `` positions in the history of visited directories; if the beginning of the history has been hit, a warning is printed.
2018-12-16 21:08:41 +00:00
2018-12-19 20:02:45 +00:00
If the `` -l `` or `` --list `` flag is specified, the current history is also displayed.
2018-12-16 21:08:41 +00:00
2018-12-19 20:02:45 +00: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-16 21:08:41 +00:00
2019-03-31 09:28:13 +00:00
You may be interested in the :ref: `cdh <cmd-cdh>` command which provides a more intuitive way to navigate to recently visited directories.
2018-12-16 21:08:41 +00:00
2018-12-19 02:44:30 +00:00
Example
2019-01-03 04:10:47 +00:00
-------
2018-12-16 21:08:41 +00:00
2018-12-19 03:14:04 +00:00
::
cd /usr/src
# Working directory is now /usr/src
cd /usr/src/fish-shell
# Working directory is now /usr/src/fish-shell
prevd
# Working directory is now /usr/src
nextd
# Working directory is now /usr/src/fish-shell
2018-12-16 21:08:41 +00:00