the env command and its examples

This command can give you the list of all the environment variables set under the system. It is used to run a program in a modified environment. Command comes from “coreutils” package.


1. To run a program to ignore environment

$ env -i
$ env –ignore-environment

2. To end each output line with 0 byte rather than newline

$ env -0
$ env –null 

3. To remove a variable from the environment

$ env -u NAME
$ env –unset=NAME

4. To display the help

$ env –help

5. To display the version

$ env –version

Leave a Reply

Your email address will not be published. Required fields are marked *