How To List Environment Variables In Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Using the printenv command: This command will print out all of your environment variables and their values.
2. Using the env command: This command is similar to printenv, but it prints out the environment variables in a more user-friendly format.
3. Using the set command: This command will print out all of your environment variables and their values in a more detailed manner.
4. Checking the /etc/environment file: This file contains all of your system-wide environment variables.
5. Checking the ~/.bashrc file: This file contains all of your user-specific environment variables.
6. Checking the /proc/sys/kernel/hostname file: This file contains the system hostname.