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.


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


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


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.

Add a Comment

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