How to permanently set $PATH on Linux/Unix?

You need to add it to your ~/.profile or ~/.bashrc file.

export PATH=$PATH:/path/to/dir

Depending on what you're doing, you also may want to symlink to binaries:

cd /usr/bin
sudo ln -s /path/to/binary binary-name

Note that this will not automatically update your path for the remainder of the session. To do this, you should run:

source ~/.profile 
or
source ~/.bashrc
posted @ 2018-01-27 14:27  2021年的顺遂平安君  阅读(34)  评论(0编辑  收藏  举报