Home>Article>Operation and Maintenance> How to check environment variables under Linux?

How to check environment variables under Linux?

藏色散人
藏色散人 Original
2019-04-03 15:37:13 39774browse

This article mainly introduces the command method to view environment variables under Linux. I hope it will be helpful to friends in need!

How to check environment variables under Linux?

Viewing environment variables

1. Use theechocommand to view a single environment variable. For example:

echo $PATH

2. Useenvto view all environment variables. For example:

env

3. Usesetto view all locally defined environment variables.

Commonly used environment variables:

PATHdetermines which directories the shell will search for commands or programs

HOMECurrent user’s home directory

HISTSIZE Number of historical records

LOGNAMECurrent user’s login name

HOSTNAME Refers to the name of the host

SHELLCurrent user Shell type

LANGUGELanguage-related environment variables, multi-language can be modified This environment variable

MAIL The current user’s mail storage directory

PS1 Basic prompt, for therootuser is#, for ordinary users it is$

Related recommendations: "Linux Tutorial"

The above is the detailed content of How to check environment variables under 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