LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   command not found (https://www.linuxquestions.org/questions/linux-newbie-8/command-not-found-280682/)

peterstudent 01-21-2005 07:48 PM

command not found
 
Hi,

I'm really a newbie because I just installed linux. I need it because we use fortran at university. I compiled just some files and called the program 'strasse'. When I enter 'strasse' to start the program linux answers with:
bash: strasse: command not found.
What's my problem? How can I start the program?

Thanks

Dark_Helmet 01-21-2005 07:59 PM

You need to tell the computer where the file is. Assuming you're in the same directory, you can do that with:
Code:

./strasse
You have to do that unless the program is in a directory listed in your PATH environment variable. To see what your PATH is, execute this:
Code:

echo $PATH

kvedaa 01-21-2005 07:59 PM

Well, it would seem that you cannot run the file because it is not in your path.

By that I simply mean the computer does not know where to look for it. If you are in the same directory as your compiled program, you will first want to ensure that the file is executable. To do a listing of the program with its permision, try:

ls -l

in the list look for your program, you should see permisions...

r - read
w - write
x - execute

If the permision is missing for a given file a '-' will act as a place holder. If you do not have 'x' for the file you will need to add the exectuable permision, one way to do this is to...

chmod +x strasse

after this re-run the listing command...

ls -l

You should now see the 'x' permision in three places (a story for a diffrent day).

Now lets try to run the program. Before the file you wish to run place a dot & slash to signify that you want to run the file in the current directory, such as...

./strasse

This should avoid the problem of the computer not finding your file.

Good luck.


All times are GMT -5. The time now is 06:40 AM.