ENV(1)

πŸ“¦
version 9.10 Β· 5 versions
, in ubuntu stonking

πŸ’– ENV(1) β€” bestie edition πŸ’–

okay so this is env, and it lives in the User Commands part of the manual. it's a User Commands girlie. let's get into it.


✨ NAME ✨

env β€” run a program in a modified environment. that's it, that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]

πŸŽ€ DESCRIPTION πŸŽ€

Set each NAME to VALUE in the environment and run COMMAND. like, you're curating the vibes before the program even walks in the room. πŸ’…

Mandatory arguments to long options are mandatory for short options too. (yes bestie, if a long option needs a value, the short one needs it too. no skipping.) ✨

  • -a, --argv0=ARG β€” pass ARG as the zeroth argument of COMMAND. yes, the zeroth. the secret one. the one nobody checks. πŸ‘‘
  • -i, --ignore-environment β€” start with an empty environment. clean slate, no baggage, healing era. 🌈
  • -0, --null β€” end each output line with NUL, not newline. NUL! not a newline, bestie. it's giving xargs -0 energy. πŸ™ˆ
  • -u, --unset=NAME β€” remove variable from the environment. bye bitch, unfollowed. ✨
  • -C, --chdir=DIR β€” change working directory to DIR.
  • -S, --split-string=S β€” process and split S into separate arguments; used to pass multiple arguments on shebang lines. we love a shebang glow-up. πŸŽ€
  • --block-signal[=SIG] β€” block delivery of SIG signal(s) to COMMAND.
  • --default-signal[=SIG] β€” reset handling of SIG signal(s) to the default.
  • --ignore-signal[=SIG] β€” set handling of SIG signal(s) to do nothing. main character refuses to react. πŸ’€
  • --list-signal-handling β€” list non default signal handling to standard error.
  • -v, --debug β€” print verbose information for each processing step. it's giving "tell me everything, I'm nosy". πŸ‘€
  • --help β€” display this help and exit.
  • --version β€” output version information and exit.

A mere - implies -i. If no COMMAND, print the resulting environment.

SIG may 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 SIG argument is a no-op. (yes, literally nothing happens. it's a vibe. it's fine.) 🫢

🚦 Exit status: 🚦

  • 125 β€” if the env command itself fails πŸ’€
  • 126 β€” if COMMAND is found but cannot be invoked 😭
  • 127 β€” if COMMAND cannot be found πŸ”
  • - β€” the exit status of COMMAND otherwise

🐚 SCRIPT OPTION HANDLING 🐚

The -S option allows specifying multiple arguments in a script. Running a script named 1.pl containing the following first line:

#!/usr/bin/env -S perl -w -T
...

Will execute perl -w -T 1.pl

Without the '-S' parameter the script will likely fail with:

/usr/bin/env: 'perl -w -T': No such file or directory

like, it's not even reading it right, it's just out here looking for a file named perl -w -T. embarrassing. 🫠

See the full documentation for more details.


πŸ“ NOTES πŸ“

POSIX's exec(3p) pages says:

"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."

^^ read that twice bestie, that's a real one. 😭


πŸ‘‘ AUTHOR πŸ‘‘

Written by Richard Mlynarik, David MacKenzie, and Assaf Gordon. icons, all three. πŸ’œ


πŸ› REPORTING BUGS πŸ›

Report bugs to: bug-coreutils@gnu.org GNU coreutils home page: https://www.gnu.org/software/coreutils/ General help using GNU software: https://www.gnu.org/gethelp/ Report any translation bugs to https://translationproject.org/team/


πŸ”— SEE ALSO πŸ”—

sigaction(2), sigprocmask(2), signal(7)

Full documentation https://www.gnu.org/software/coreutils/env or available locally via: info '(coreutils) env invocation'

Packaged by Ubuntu (9.10-1ubuntu2) 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.


and that's the whole page, bestie πŸ’– this was GNU coreutils 9.10, from August 2026, and it's the ENV(1) page. periodt. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from