Editing Your PATH

Question: Why do I always have to specify the full path of the commands for my favorite programs?

If you frequently start programs that are not located in a directory that your user shell has been configured to search, you will have to edit your user shell configuration file to add the directory containing the executable you wish to run. You can do this by adding the directory to your PATH environment variable.


These instructions are intended only for user accounts. Avoid modifying files such as the root user's .bash_profile because of the potential security risks.

Start a text editor such as pico at a shell prompt. You can open the file called .bash_profile by typing the following:

pico .bash_profile

You will see a PATH statement similar to the one shown below:


To the end of this statement, append $HOME/seti: as follows:


Now, press Ctrl-X; you will be asked whether you want to save "the modified buffer" (that's what pico calls an updated file); type y for "yes." Next, you will see the name the file will be saved as; press the Enter key.

You can then make the changes to .bash_profile take effect immediately by typing the following command:

 source .bash_profile 

By doing the above, you do not have to manually add $HOME/seti: to the beginning of the executable to start an application located in the directory you've added to your PATH.

The Red Hat Documentation Team - Official Red Hat Linux User's Guide
The Red Hat Documentation Team - Official Red Hat Linux User's Guide
Year: 2002
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net