STRING-TRIM(1)
πΈ STRING-TRIM(1) β the fish-shell one, bestie πΈ
okay so this is a page from the fish-shell manual set, and it's lowkey one of the cutest little commands ever. it's called string-trim, and it does exactly one thing but it does it iconically. let's get into it π
β¨ NAME β¨
string-trim β literally just: remove trailing whitespace π
β¨ SYNOPSIS β¨
string trim [-l | --left] [-r | --right] [(-c | --chars) CHARS]
[-q | --quiet] [STRING ...]
look at her. so tidy. so composed. main character energy fr fr π¦
β¨ DESCRIPTION β¨
string trim removes the leading and trailing whitespace from each STRING. like, both ends. the whole glow-up. no cap.
but wait, you can be picky about it π
-l,--leftβ only the leading whitespace gets removed. left side only, bestie. the right side stays exactly as it is.-r,--rightβ only the trailing whitespace gets trimmed. right side only this time.
and then there's the switch that changes the whole vibe:
-c,--charsCHARS β this makes the set of characters in CHARS get removed instead of whitespace. and listen, this is the part that gets people: it's a set of characters, not a string. so if you pass-c foo, it will remove any"f"or"o"β not"foo"as a whole unit. it's giving "individual letters, not the squad" π so keep that in mind before you go shipping a whole word into it.
π exit status:0if at least one character was trimmed, or1otherwise. that's it. that's the vibe check.
β¨ EXAMPLES β¨
okay these go so hard, watch this π
>_ string trim ' abc '
abc
trimmed both sides, ate, left no crumbs π₯
>_ string trim --right --chars=yz xyzzy zany
x
zan
so here --right means only the right side gets touched, and --chars=yz means the set is y and z β so on xyzzy the trailing y and z get nibbled away down to x, and on zany the trailing y and z... well, the trailing ones go, and you're left with zan. iconic behaviour honestly π
oh and also β -q / --quiet is right there in the synopsis. this page doesn't elaborate on it beyond that, so I'm not gonna make stuff up, bestie. it's in the synopsis, it's part of the command, periodt π
β¨ Copyright β¨
fish-shell developers π«Ά β shoutout to the whole crew, they understood the assignment.
and that's the whole page!! go trim something, you're gonna slay πβ¨ππ¦πΈ
this was page 4.9, dated Sep 08, 2026 β mwah, see you in the next manpage 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