Tutorial: Setting PATH in Ubuntu

Sunday, August 18, 2013

Adding directory to system PATH variables in Ubuntu is easy. Why we must setting path on system? because with setting path, it make easier to run an application or command through a Terminal or by command line.

To setting path in Ubuntu can in 2 ways: temporary path and permanent path.
  1. Temporary PATH
    • Run terminal
    • Then type this command:
      export PATH=/path/to/directory:$PATH
      */path/to/directory is directory what you want to save in PATH.
  2. Permanent PATH
    For this way, you must edit file .bashrc
    • Run Terminal
    • Go to root or super user by type: sudo su
    • Type this command:
      gedit ~/.bashrc
    • Then add this script at the top
      export PATH=/path/to/directory:$PATH
    • Save file .bashrc after you add that script.
After set you PATH variable environment, you can try to type application name or command from directory what you set before.


No comments :

Post a Comment

 

Search This Blog

Follow My Twitter

Archives