Home  >  Article  >  Operation and Maintenance  >  What is the command to view environment variables in Linux?

What is the command to view environment variables in Linux?

尊渡假赌尊渡假赌尊渡假赌
尊渡假赌尊渡假赌尊渡假赌Original
2023-07-06 17:10:428478browse

The command to view environment variables in Linux is "echo $ variable name". For example, to view the value of the PATH environment variable, you can execute the "echo $PATH" command. You can find specific environment variables and obtain them as needed. value.

What is the command to view environment variables in Linux?

The operating system of this tutorial: Linux5.18.14 system, Dell G3 computer.

In Linux systems, you can use the echo $ variable name command to view the value of a specific environment variable.

For example, to view the value of the PATH environment variable, you can execute the following command:

echo $PATH

If you want to view all environment variables and their corresponding values, you can use the env command or printenv Order. The effect of the two is the same, just execute any of the following commands:

env

or

printenv

This will list a list of all environment variables defined in the current environment and their values. You can look up specific environment variables and get their values ​​if needed.

The above is the detailed content of What is the command to view environment variables in Linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn