c programming in linux

  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.
Who is Participating?
interiotConnect With a Mentor Commented:
You can try putting

    export PATH=.:$PATH

in your ~/.bashrc (since you appear to be running bash).
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 "./".
huerAuthor Commented:
Thank you very much interiot.
I wish i can get more helps from you later on.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.