PREVD(1)
π« PREVD(1) β the fish-shell girlies' guide π«
okay so real quick: this is prevd, one of the little directory-history besties from fish-shell (yes that fish-shell, the one you already love) π
and honestly? she's about to make your cd game iconic.
π NAME π
prevd β move backward through directory history π¦ like, the time machine but for folders, no cap.
β¨ SYNOPSIS β¨
prevd [-l | --list] [POS]
πΈ DESCRIPTION πΈ
so prevd moves backwards POS positions in the history of visited directories (that's the directory history, iykyk). and if you've hit the very beginning of the history? she prints a warning. not to be dramatic but π it's giving "you've reached the edge of the map, bestie."
if you throw in the -l or --list flag, the current history gets displayed too. so you can literally see where you've been. love that for you β¨
heads up bestie, important lore: thecdcommand limits directory history to the 25 most recently visited directories. and that history? it's stored in thedirprevanddirnextvariables, which this command manipulates. soprevdis out here touching the variables. main character energy fr fr.
also, the -h or --help option displays help about using this command. she's helpful like that π«Ά
π₯ EXAMPLE π₯
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
look at her go ππ back and forth, absolutely slaying the navigation game.
π SEE ALSO π
- the
cdhcommand to display a prompt to quickly navigate the history π - the
dirhcommand to print the directory history π - the
nextdcommand to move forward π
π Copyright π
fish-shell developers β hold the copyright, respect the copyright, periodt π
okay that's the whole page!! brought to you by fish-shell version 4.9, dated Sep 08, 2026 β literally stamped and sealed, mwah πβ¨ go forth and prevd responsibly bestie π
π¦ 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