TD-e.com

TD-enotes title image
English
spacer

              


Bash command not found

Tips for the Linux user.



Problem:

In the console (or a terminal window), we type:
cd /path_name_where_a_program_is


Then we type:
name_of_program


The answer is:
command not found

Of course we admit that we did verify that the requested program is really available and stored in the directory where we do expect it to be. We did also verify that the executable bit is set in the file properties.

Solution:

The reason for the error message is probably the lack of the current directory in the command path. If the local directory (.) is not in the command path, the program name must be preceeded with
./
Thus we will type:
./name_of_program
instead of:
name_of_program
and the program will run.

To avoid to have to type the ./ before the name of the program each time, we could add a period representing the current directory (.) to the command path. The command path is in the environment variable $PATH. It is usually in /etc/profile.

The Suse installation tells us not to modify /etc/profile because modifications may go lost during system updates. Instead we should put our additional settings into the file /etc/profile.local.

In the environment variable $PATH, directories are usually separated with a colon. To achieve the above, the local directory (a period) should be added.

Blog of TD-e.com
Add a comment


Main |  Software |  Photo |  Quiz |  Reviews |  Tips |  Tutorials |  Flags |  Contact |  About


Page tested with Opera, Epiphany, Konqueror, Firefox.
Copyright © 2005-2008 td-e.com, All rights reserved.
... ...
.. ..
. .