Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-14-2003, 04:37 AM   #1
LQ Newbie
Registered: Mar 2003
Posts: 5

Rep: Reputation: 0
Running C code in Redhat 7.2

I'm new to this forum and a unix newbee. You'll probably see lots of posts from me comming up for the next few months.

I had to install unix because I'm doing C programming for unix.
I started with something simple, a hello world C program, which I saved as hello.c

I then compiled as
gcc hello.c -o hello

This makes an executable binary file in the same dir.
But how do I run it? If I just type 'hello' and press enter it says 'command not found'. I also tried running it through the GNOME interface but nothing happens.

I'm using Redhat 7.2 with GNOME.
Old 03-14-2003, 05:26 AM   #2
LQ Guru
Registered: Nov 2002
Location: Durham, England
Distribution: Fedora Core 4
Posts: 1,565

Rep: Reputation: 57
For security reasons the current directory is not normally in your PATH on most Linux setups. To run a program in the current directory, do this:

Old 03-14-2003, 05:52 AM   #3
LQ Newbie
Registered: Mar 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks mhearn. That did the trick.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
running executable in C++ code psIpher Programming 2 11-25-2005 01:44 PM
User Preferences: Use HTML code instead of vB code? (vB code is overrated) stefanlasiewski LQ Suggestions & Feedback 5 07-26-2005 01:37 AM
what is the file location of Redhat source code?? nazib Linux - General 1 02-26-2005 03:18 AM
porting a C++ code to redhat Linux environment KevinG Programming 12 01-02-2004 03:55 PM
how to compile redhat 9.0 source code. wood Linux - General 5 09-16-2003 10:05 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:44 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration