Running UNIX Commands from C

Hi,

-How can I get number of files, cpu usage (percentage), memory usage, disk usage, ...etc, using C program ... I can use unix command ( system(command) )but I want the value to be returned back to my C program to use it in my code? How can I do that?

Thanks in advance ...

Good luck

I use popen() function and it works ...
Thank you soo much ...