Question: Is Export Permanent Linux?
Contents

How do I permanently export an environment variable in Linux?

To make the change permanent, enter the command PATH=$PATH:/opt/bin into your home directory’s . bashrc file. When you do this, you’re creating a new PATH variable by appending a directory to the current PATH variable, $PATH .

How do I permanently export a path in Linux?

I think the most elegant way is:

  1. Add this in the ~/. bashrc file. Run this command: gedit ~/.bashrc. Add your path inside it: export PATH=$PATH:/opt/node/bin.
  2. source ~/.bashrc.
James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest