12

In man pages, where can I find a detailed description of the environment variables that are listed when env command is run?

I have tried man env but it only provides me one example for TZ environment variable

  • You probably can't find a description of all of them, simply because any application is free to define & use environment variables of its own. For instance, on my system, there are environment vars that belong to my editor, MPI, CUDA, Java, QT, and more. – jamesqf Nov 30 '18 at 17:30
22

On Linux, man 7 environ describes a number of common environment variables, and gives references to other man pages which describe them in more detail. Equivalents exist on other systems; see for example the FreeBSD version. (Historically, Unix V7 had an equivalent in section 5; the BSDs have had this in section 7 since at least BSD4.3.)

In general, to look through all the man pages which mention a given environment variable, you can use man -K, which runs a full-text search in all the installed man pages’ sources, with the -w and -i options (which respectively list man pages instead of viewing them, and match the strings’ case):

man -Kiw TZ
  • 4
    See also Alt+/ in info to recursively search info pages from the info directory (Alt+} for next entry). – Stéphane Chazelas Nov 30 '18 at 13:32
  • 4
    Also info -k ENV_VAR_NAME to look for that in all info indexes. Or even better: within info: Alt+x index-apropos – Stéphane Chazelas Nov 30 '18 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.