linux设置环境变量

比如首先在/etc/profile里面增加这几个环境变量

export PATH=$PATH:/mnt/f/ubuntu/goProject/go/bin
export GOROOT=/mnt/f/ubuntu/goProject/go
export GOPATH=/mnt/f/ubuntu/goProject

然后要在~/.bashrc里面增加下面这个,每次打开就会自动source

source /etc/profile

原文地址:https://www.cnblogs.com/haima/p/13326961.html