Server Fault is a question and answer site for system and network administrators. 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

I've been running the following command on my linux box:

watch -d -n 1 "cat /proc/19866/stat"

The pid above is a pid of Nginx's master process - I would expect the following fields to be changing: 14, 15, 16 and 17 as according to kernel docs those should contain amount of time the process has been scheduled in user/kernel mode (14,15) and its children too (16,17), however running this command in watch I noticed that none of those numbers ever change. Can someone shed a bit more light on this ? I'd like to count some CPU usage stats per process and I thought /proc.. was the place to look. Thanks!

share|improve this question

Try constructing a simple shell script using the ps command. Based on the implementation, you can get the command to output only those fields that are interesting to you.

share|improve this answer
but isn't ps reading from /proc too ? At least that's what I thought it was doing... – gyre Jan 6 '13 at 1:50

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.