centos path
centos path
To modify the PATH environment variable in CentOS, you can use several methods. Here are the most common ones:
Temporary Change
To temporarily add a directory to your PATH, use the export command. This change will only last for the current terminal session.
export PATH=/usr/local/mongodb/bin:$PATH
############
Permanent Change for Current User
To make the change permanent for the current user, add the export command to your .bashrc file.
vi ~/.bashrc
# Add the following line at the end of the file
export PATH=/usr/local/mongodb/bin:$PATH
# Save and exit, then run:
source ~/.bashrc
############
# 检查 GOBIN 是否已设置(输出为空表示未设置)
go env GOBIN
# 若未设置,请配置(根据实际修改示例路径)
go env -w GOBIN=/mnt/d/shareData/gobin
# 然后将 GOBIN 路径添加到系统 PATH 环境变量
#eg. add dir to path /mnt/d/shareData/gobin
#Permanent Change for All Users
#To make the change permanent for all users, modify the /etc/profile file.
# vi /etc/profile
# Add the following line at the end of the file
export PATH=/mnt/d/shareData/gobin:$PATH
# Save and exit, then run:
source /etc/profile