Wednesday, March 21, 2012

How to change $PATH variable in ubuntu

PATH variable in Windows and Linux will help the operating system to find the commands we are executing in the command line within the system.

In other words, if you want to run any command within any folder in your system, system should be able to find that command file. PATH variable contains the folders in which that particular command you have typed, can be stored in the system.

 if you want your custom commands or tools to be run from anywhere in the command line, you need to add the folder which contains that command or tool in to the PATH variable.

in Windows you can change the PATH variable in the Enviornment variables section under system variables. (You can get the System properties window by clicking WIN + Pause keys. )

in ubuntu you change the path within the command line by typing the following command.

export PATH=/folder/contains/the/tool:$PATH

This will add the folder "/folder/contains/the/tool" to the system PATH variable. Then you can run your command or tool from anywhere in the system.

cheers !!!!!!!!!!!!!!!!

No comments:

Post a Comment