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 dirh command β€” prints out the directory history for you πŸ“
  • the prevd command β€” moves you backward through it πŸ’œ
  • the nextd command β€” moves you forward through it πŸ”₯

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