Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

enter image description here

i wrote a hello world example.and run successfully,but i don't know where it is in the linux sys. When I run the command which hello.c. it doesn't show the path of the hello.c file . how to find out where's the path of the hello.c file. thank you

share|improve this question

migrated from Dec 1 '11 at 0:52

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted

It's likely in the current directory. Try ls -l hello.c.

Also, don't compile or debug software as root unless you have to. A bug in your code could completely hose your system.

share|improve this answer
+1, especially if you're using ./ before the command – Canadian Luke Dec 1 '11 at 0:55

which shows you the location of executables; hello.c is a source file. If you wrote it, ideally you should remember where you put it. If not, something like

find ~ -name hello.c

might be useful (if it's somewhere under your home directory).

But first, try

ls -l hello.c
share|improve this answer

Run find / -type f -name 'hello.c' as root. Depending on how big and how stuffed your hard drive is, it will take some time.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.