CDH(1)
π¦ CDH(1) β fish-shell edition β¨
okay so this is the manual page for cdh, straight out of fish-shell (yes bestie, that fish π
), and it's genuinely one of those little commands that changes your whole life. let's get into it π«Ά
πΈ NAME πΈ
cdh β change to a recently visited directory. that's it. that's the vibe. you hop back to somewhere you've already been, no typing out the whole giant path like a clown π
β¨ SYNOPSIS β¨
cdh [DIRECTORY]
π DESCRIPTION π
so <italic>DIRECTORY</italic> is optional, and that's the whole magic of it π
cdh with no arguments pulls up a list of your recently visited directories (the directory-history situation β you know the one) and justβ¦ shows it to you. then you pick one by hitting its letter or its **number`. easy. and if you're a tab gremlin like me, you can also press Tab to bring up the completion pager and select an item from the list that way π
cdh with a single argument? no menu, no choosing, it's literally just equivalent to:
cd DIRECTORY
periodt. π
ngl, there's a caveat you need to know: the cd command only keeps the 25 most recently visited directories in the history. twenty-five. that's the cap, bestie, no negotiating π
the history itself lives in the dirprev and dirnext variables, and cdh is the one manipulating them behind the scenes π§ if you go and make those universal variables, your cd history gets shared across all your fish instances β every single one, same history, iconic behavior fr fr β¨
π SEE ALSO π
- the
dirhcommand β prints out the directory history for you π - the
prevdcommand β moves you backward through it π - the
nextdcommand β moves you forward through it π₯
π Copyright π
copyright belongs to the fish-shell developers π«Ά
and that's a wrap, bestie π this page is from fish-shell version 4.9, dated Sep 08, 2026 β go forth and cdh responsibly, mwah π
π¦ where this page comes from
- arch rolling: fish 4.9.3-1 Β· GPL-2.0-only AND BSD-3-Clause AND ISC AND MIT AND PSF-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms