-
env
A list of all the current environmental variables and their values for the current user, including all the directories in the
PATH
variable, can be seen by running theenv
command without any options or arguements. -
PATH
PATH
is an environmental variable in Linux and other Unix-like OS that tells the shell which directories to search for executable files in response to commands issued by a user.env | grep PATH echo $PATH
-
Change PATH
PATH variables can be changed relatively easily. They can be changed just for the current login session, or they can be changed permanently.
-
current login session change
PATH="/usr/sbin:$PATH" PATH = $PATH:/usr/sbin export PATH export PATH=$PATH:/usr/sbin
-
permanently
Add upper into the user’s
.bash_profile
file..bash_profile
is a hidden file in each user’s home directory that defines any specific environmental variables and startup programs for that user.A hidden file is a file whose name begins with a dot and which is normally not visible.
-
-
References
Linux添加路径到PATH||env
最新推荐文章于 2024-06-06 18:48:06 发布