Home > Article > Operation and Maintenance > What is the command to view environment variables in Linux?
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.
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!