简体   繁体   中英

Export of PATH not permanent

I'm using this command to export the path to use some packages I installed globally.

export PATH=~/.composer/vendor/bin:$PATH

the problem is whenever I restart my machine, I would still need to export it again.

Is there a way to make this export permanent?

Yes, many a times that's the problem with doing export PATH .

You should append the environment variable directly into your .bash_profile file! This will be permanent and solve your purpose,thereby, making your package used globally without any further problem with the package's path.

Append the following to the end of your .bash_profile file,and replace the ~ with the actual path,ie, /home/user_name :-

PATH=/home/user_name/.composer/vendor/bin:$PATH
export PATH

将此行添加到您的〜/ .bash_profile中:

export PATH=$HOME/.composer/vendor/bin:$PATH

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM