• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

compile and run c program in linux

Just getting started.

I wrote the basic hello.c and ran cc -g -ohello hello.c

I got an executable hello (based on ls -F) and when I type hello I get a "command not found" error.

What's up!
  • 2
1 Solution
type ./hello
spstrongAuthor Commented:

What is the deal?

If I write a REAL application how do I get it set up for the user to just type the application name?
spstrongAuthor Commented:
For those of you who come here looking for the answer to the question, Linux (and I suppose UNIX in all its flavors) doesn't see the current directory as automatically part of the path.  To add it to the path:


will add it to the path.

type set  |more to see if it took.

stephen p.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now