Home>Article>Operation and Maintenance> How to check environment variables under Linux?
This article mainly introduces the command method to view environment variables under Linux. I hope it will be helpful to friends in need!
Viewing environment variables
1. Use theecho
command to view a single environment variable. For example:
echo $PATH
2. Useenv
to view all environment variables. For example:
env
3. Useset
to view all locally defined environment variables.
Commonly used environment variables:
PATH
determines which directories the shell will search for commands or programs
HOME
Current user’s home directory
HISTSIZE
Number of historical records
LOGNAME
Current user’s login name
HOSTNAME
Refers to the name of the host
SHELL
Current user Shell type
LANGUGE
Language-related environment variables, multi-language can be modified This environment variable
MAIL
The current user’s mail storage directory
PS1
Basic prompt, for theroot
user 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!