NOT(1)
π NOT(1) β a fish-shell icon, bestie
okay so real talk, this is the not page from the fish-shell manual and honestly? she's short, she's powerful, she's giving main character energy in like four lines of docs. let's get into it π«Ά
β¨ NAME β¨
not β negate the exit status of a job. that's it. that's the whole vibe. she flips your exit codes and dips π
π SYNOPSIS π
not COMMAND [OPTIONS ...]
! COMMAND [OPTIONS ...]
literally two ways to spell the same slay β¨
πΈ DESCRIPTION πΈ
okay so here's the tea: not negates the exit status of another command. and the logic is exactly what you'd expect, no cap:
- if the exit status is zero,
notreturns1π« - otherwise,
notreturns0π
that's it. that's the whole personality. she's a hater in the most useful way possible π
also, a lil heads up: some other shells only support the ! alias, so if you're out here being portable, ! is your girl. iykyk π
the -h or --help option displays help about using this command. use it if you're ever like "wait what does this do again" β no judgment, we've all been there π§
π EXAMPLE π
okay this is the moment, this is the example that ate π
the following code reports an error and exits if no file named spoon can be found:
if not test -f spoon
echo There is no spoon
exit 1
end
the way that this is literally the matrix reference in the official docs and nobody talks about it π iconic behavior fr fr. note that not is doing the heavy lifting: test -f spoon fails when there's no spoon, not flips that failure into a success, and the if block runs. no spoon? no problem. exit 1 and tell them about it π₯
π Copyright π
fish-shell developers ππ
okay bestie, that's the whole page β go negate something responsibly, and remember: every exit status deserves a vibe check βπ
this was NOT(1), version 4.9, dated Sep 08, 2026 β signed, sealed, and slayed by yours truly ππ¦
π¦ 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