seemingly dumb-ass question

David Korn
Fri Feb 16 05:43:00 GMT 2001

>-----Original Message-----
>From: Gareth Clark [ ]
>Sent: 16 February 2001 13:21

>This is probably very easily answered but when i want
>to run a program which I have compiled with 'gcc
>filename.c -o filename.exe' how do i run it? if i type
>filename.exe i just get 'command not found' back. 
>I am using Red Hat 6.2 with the default version of

    Hi Gareth,

 It is indeed very easy.  Linux doesn't search the current directory for
programs to be run unless you specifically add it to the path with a line
such as

 export PATH=$PATH:.

or alternatively, you can specify that your executable is in the current
directory when you try to run it by putting ./ in front of the filename


  Of these, it is better to get into the habit of adding ./ to your 
commands, because having the current directory in your path is theoretically
a security risk (if someone could arrange for a trojan version of ls, for
example, to be in one of your directories, you might accidentally run it
when you tried to get a directory listing; if you don't have . in the path
that can't happen).

we are not seats or eyeballs or end users or consumers.
we are human beings - and our reach exceeds your grasp.
                    deal with it.                      - 

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

More information about the Gcc-help mailing list