Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all Linux environment variables including LD_LIBRARY_PATH

How to list all the environment variables in Linux?

When I type the command env or printenv it gives me lots of variables, but some variables like LD_LIBRARY_PATH and PKG_CONFIG don't show up in this list.

I want to type a command that list all the environment variables including this variables (LD_LIBRARY_PATH and PKG_CONFIG)

like image 370
Michael harris Avatar asked Jan 14 '14 19:01

Michael harris


1 Answers

env does list all environment variables.

If LD_LIBRARY_PATH is not there, then that variable was not declared; or was declared but not exported, so that child processes do not inherit it.

If you are setting LD_LIBRARY_PATH in your shell start-up files, like .bash_profile or .bashrc make sure it is exported:

export LD_LIBRARY_PATH
like image 69
Maxim Egorushkin Avatar answered Sep 22 '22 21:09

Maxim Egorushkin