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: the cd command limits directory history to the 25 most recently visited directories. and that history? it's stored in the dirprev and dirnext variables, which this command manipulates. so prevd is 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 cdh command to display a prompt to quickly navigate the history 🌈
  • the dirh command to print the directory history πŸŽ€
  • the nextd command to move forward πŸ’œ

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