Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

16.3. Starting Applications

I installed an application I downloaded from the Internet, and everything seemed to go fine, but I still get "command not found" when I type its name. I think I have the right name, so why will it not start?

If you are trying to start an application from the shell prompt and it is not working, try typing out the full directory path before the name of the application's executable (such as /usr/local/bin/my-executable).

For example, imagine that you have downloaded the setiathome client application and want to try it out. You follow the directions for installing the software, which creates a subdirectory in your home directory called seti/. Now, start the application using the full path to the executable file as shown below:

/home/joe/seti/setiathome

The reason you may need to type the full pathnames in order to start an application is because the executable was not placed in a directory where your user shell environment knew it could be found (such as /usr/local/bin).

You can customize your settings so that you are not required to use the type the full path to the application each time. To do this, you will have to edit your PATH environment variable.

16.3.1. Editing Your PATH

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.

CautionCaution
 

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 gedit or vi, at a shell prompt. You can open the file called .bash_profile by typing the following:

gedit .bash_profile

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

PATH=$PATH:$HOME/bin:/usr/local/bin:

To the end of this statement, add $HOME/seti as shown below:

PATH=$PATH:$HOME/bin:/usr/local/bin/:$HOME/seti:

Save the file and exit the text editor.

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

source .bash_profile

By adding paths to your .bash_profile, you can place utilities and programs in your path and be able to execute them without having to type ./ in front of the command.

TipTip
 

For more information about using and configuring your shell prompt refer to Chapter 13 Shell Prompt Basics.

 
 
  Published under the terms of the GNU General Public License Design by Interspire