Daily Archives: September 14, 2018

Set Permanent Base PATH Variable on Ubuntu

how to add a directory to the PATH environment variable in linux?

Set Permanent Base PATH Variable on Ubuntu

Open terminal and type command “sudo su”, then edit bashrc file with nano or vim like below:

nano ~/.bashrc

After that copy and paste your export PATH into bashrc file then save and exit.

Summary

The bashrc file will run when you login via the console, or log in using ssh. After that your PATH settings from bashrc will then be available. In contrast, once you are logged in, and you open a command shell or run the bash command.