ENV(1)
๐ NAME ๐
okay so bestie, welcome to env(1) โ this is a User Commands page, and it's literally the girlboss of environment manipulation: run a program in a modified environment. that's the whole vibe. she sets your vars, she runs your program, she does NOT do small talk. ๐
โจ SYNOPSIS โจ
env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]
like. that's it. that's the shape of her. ๐
๐ธ DESCRIPTION ๐ธ
the entire job description, no cap: Set each NAME to VALUE in the environment and run COMMAND. that's the assignment and she ate.
quick heads up that applies to literally every option below: mandatory arguments to long options are mandatory for short options too. so if a long one needs a value, the short one needs it too. don't fight it. ๐ซถ
okay here's every single flag, bestie, all of them, in order:
-a,--argv0=ARGโ passARGas the zeroth argument ofCOMMAND. yes, the zeroth. the one before the first one. main character energy. ๐-i,--ignore-environmentโ start with an empty environment. clean slate, blank canvas, fresh start, we love to see it โจ--env0-from=FILEโ read NUL-delimited environment entries fromFILE. NUL-delimited, so mind your separators ๐ฆ-0,--nullโ end each output line with NUL, not newline. for when newlines are simply not the moment ๐-u,--unset=NAMEโ remove variable from the environment. gone. blocked. unfollowed. ๐-C,--chdir=DIRโ change working directory toDIR. we're moving, bestie, pack your bags ๐ง-S,--split-string=Sโ process and splitSinto separate arguments; used to pass multiple arguments on shebang lines. she's the shebang whisperer fr fr ๐--block-signal[=SIG]โ block delivery ofSIGsignal(s) toCOMMAND--default-signal[=SIG]โ reset handling ofSIGsignal(s) to the default--ignore-signal[=SIG]โ set handling ofSIGsignal(s) to do nothing--list-signal-handlingโ list non default signal handling to standard error-v,--debugโ print verbose information for each processing step. she's telling you everything, she's being so transparent ๐ฅ--helpโ display this help and exit--versionโ output version information and exit
and then the iconic little shortcut: a mere - implies -i. one dash, whole personality change. ๐ญ
also: if no COMMAND, print the resulting environment. so if you just wanna see the env, she'll show you the env. no program, no problem.
one more thing about those signal options, listen up:
SIGmay be a signal name like'PIPE', or a signal number like'13'.- Without
SIG, all known signals are included. - Multiple signals can be comma-separated.
- An empty
SIGargument is a no-op.
got it? got it. ๐
โญ Exit status: โญ
the numbers that matter, and you WILL be checking these:
125โ if theenvcommand itself fails126โ ifCOMMANDis found but cannot be invoked127โ ifCOMMANDcannot be found-โ the exit status ofCOMMANDotherwise
127 is the "girl where are you" of exit codes. she looked. she did not find her. ๐
๐ฆ SCRIPT OPTION HANDLING ๐ฆ
okay this section is the reason -S exists and it's genuinely so useful, pay attention bestie.
the -S option allows specifying multiple arguments in a script. so say you've got a script named 1.pl and its first line is this:
#!/usr/bin/env -S perl -w -T
...
then she will execute perl -w -T 1.pl. periodt. that's the magic. โจ
but WITHOUT the '-S' parameter? the script will likely fail, and it fails like this:
/usr/bin/env: 'perl -w -T': No such file or directory
because without -S she reads the whole thing 'perl -w -T' as ONE filename, and that filename is not real, and she is confused, and honestly same. ๐ญ
See the full documentation for more details. there's more, go look, iykyk ๐
๐ NOTES ๐
okay this one is important, it's a whole quote from POSIX's exec(3p) pages, and it's giving "we've all made mistakes":
"many existing applications wrongly assume that they start with certain signals set to the default action and/or unblocked.... Therefore, it is best not to block or ignore signals across execs without explicit reason to do so, and especially not to block signals across execs of arbitrary (not closely cooperating) programs."
translation: don't be out here messing with signal handling across exec for no reason, especially not into random programs that aren't in on the plan. that's the caution, and it's real. ๐
๐ AUTHOR ๐
Written by Richard Mlynarik, David MacKenzie, and Assaf Gordon. legends, all three. bow down. ๐
๐ REPORTING BUGS ๐
found a bug? tell the girlies, they wanna know:
- Report bugs to:
<bug-coreutils@gnu.org>. - Report any translation bugs to:
<https://translationproject.org/team/>. - GNU coreutils home page:
<https://www.gnu.org/software/coreutils/> - General help using GNU software:
<https://www.gnu.org/gethelp/>
๐ COPYRIGHT ๐
Copyright ยฉ 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. like, none. zero. don't come for her. ๐
โจ SEE ALSO โจ
go read these next, they're the friend group:
Full documentation <https://www.gnu.org/software/coreutils/env> or available locally via: info '(coreutils) env invocation'
and that's the page, bestie!! ๐ซถ this one's from GNU coreutils 9.12, dated September 2026 โ so if you're reading this, you're reading the freshest possible env(1), and honestly? she ate. go modify some environments. slay. ๐๐๐ฆ
๐ฆ where this page comes from
- arch rolling: coreutils 9.12-2 ยท GPL-3.0-or-later AND GFDL-1.3-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms