What is the command to view environment variables in Linux?

尊渡假赌尊渡假赌尊渡假赌
Release: 2023-07-06 17:10:42
Original
8357 people have browsed it

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
Copy after login

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
Copy after login

or

printenv
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!