env

A command that prints the environment, or runs another program with a changed environment or found through PATH.

In more detail

With no arguments it lists every environment variable as name=value. In a shebang line such as #!/usr/bin/env python3 it searches PATH for the interpreter, so the script works wherever that interpreter is installed. env -i cmd runs a command with an empty environment.

Examples

env | sort
#!/usr/bin/env bash

Related terms

Taught in

References

Certification courses