Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Dec 1 '11 at 0:52

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

3 Answers 3

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

 
discard

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