Printenv command tutorial in linux/unix with examples and use cases

linux printenv command – print all or part of environment

Print the values ​​of the specified environment VARIABLE (s). If no VARIABLE is specified, print name and value pairs for  them all.

Syntax

       printenv [OPTION]... [VARIABLE]...

Options

  • -0, –null
    end each output line with NUL, not newline

Examples

Print name and value pairs for all environment variables

➜  ~ printenv

You can also use the env command without parameters to print all the name and value pairs of all environment variables.

Best linux commands articles:

Linux common commands tutorial and use examples
Sed command tutorials in linux/unix with examples and use cases
Awk command tutorials in linux/unix with examples and use cases

Add a Comment

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