CDH(1) fish-shell CDH(1)

# [NAME](#NAME)

cdh - change to a recently visited directory

# [SYNOPSIS](#SYNOPSIS)

```
cdh [DIRECTORY]
```

# [DESCRIPTION](#DESCRIPTION)

**cdh** with no arguments presents a list of recently visited directories &lt;#directory-history&gt;. You can then select one of the entries by letter or number. You can also press **tab** to use the completion pager to select an item from the list. If you give it a single argument it is equivalent to **cd DIRECTORY**.

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. If you make those universal variables, your **cd** history is shared among all fish instances.

# [SEE ALSO](#SEE_ALSO)

- the dirh &lt;&gt; command to print the directory history
- the prevd &lt;&gt; command to move backward
- the nextd &lt;&gt; command to move forward

# [Copyright](#Copyright)

fish-shell developers

October 15, 2026 4.9

---

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