DIRH(1) fish-shell DIRH(1)

# [NAME](#NAME)

dirh - print directory history

# [SYNOPSIS](#SYNOPSIS)

```
dirh
```

# [DESCRIPTION](#DESCRIPTION)

**dirh** prints the current directory history &lt;#directory-history&gt;. The current position in the history is highlighted using the color defined in the **fish\_color\_history\_current** environment variable.

**dirh** does not accept any parameters.

Note that the cd &lt;&gt; command limits directory history to the 25 most recently visited directories. The history is stored in the **$dirprev** and **$dirnext** variables.

# [SEE ALSO](#SEE_ALSO)

- the cdh &lt;&gt; command to display a prompt to quickly navigate the history
- the prevd &lt;&gt; command to move backward
- the nextd &lt;&gt; command to move forward

# [Copyright](#Copyright)

fish-shell developers

October 12, 2026 4.9

---

Document: dirh(1) from fish 4.9.3-r2 (Chainguard OS)
Source: https://github.com/fish-shell/fish-shell
