env command

All,

what is env command used for in Unix?

Regards
Oracle User

There is something called 'Environment Variables' which is set by default in a shell, when user login.
These variables are used by system processes, for the commands to work etc.

All these variables can be seen by the command 'env'

The external env command creates a new environment for executing a given command. Depending on the options, env either uses the current environment or completely ignores it. If env uses the environment, modifications are made based on the arguments given. After the new environment is set up, the command argument is executed.

The env command is useful for testing commands in controlled environments. It may be used to execute a command in a new environment without affecting your own personal environment. It is probably used more to display the current environment than as a command executor.

Following is the general format of the env command.
env [ - ] [ name=value ... ] [ command [ options ] [ args ] ]