Link to home
Start Free TrialLog in
Avatar of huer
huer

asked on

c programming in linux

Hello,
  I am a newcomer to linux and just installed RedHat 7.0 in my PC. I wrote a very simple C program such as printing Hello World on the screen and complied the source code by typing
   gcc -o hello hello.c
The compling is Ok and a file called hello was generated.
But when i type hello to excute, it gave me such message:
bash: command hello not found.

I am really not familia with linux. Is anything wrong with the system? Or do i have to change any system file(such as .cshrc in Unix)?

Thank you.
Avatar of interiot
interiot

Try ./hello

Shells won't automatically search the local directory unless "." is part of your path, in which case you have to prepend things with "./".
ASKER CERTIFIED SOLUTION
Avatar of interiot
interiot

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of huer

ASKER

Thank you very much interiot.
I wish i can get more helps from you later on.