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, not returns 1 🫠
  • otherwise, not returns 0 πŸ‘‘

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 πŸ”₯


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