Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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'm trying to get running processes from a linux server but I having some doubts. If I get top exit I have:

# top -b -n1 | head -n5
top - 16:18:19 up 60 days, 21:22,  8 users,  load average: 0.03, 0.13, 0.15
Tasks: 1274 total,   7 running, 1267 sleeping,   0 stopped,   0 zombie
Cpu(s):  1.6% us,  2.4% sy,  0.0% ni, 95.8% id,  0.1% wa,  0.0% hi,  0.0% si
Mem:   6291556k total,  5269044k used,  1022512k free,    29976k buffers
Swap:  6291448k total,    82508k used,  6208940k free,   649292k cached

What I want to know is which processed are the "7" that top says that are "running" in the second line.

I've try "ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm" and filter by "stat" status equal to "R" but I'm not able to get this 4 processes. I've always get the "ps and grep" and sometimes I get another one, but not not the seven tha ttop shows.

Is there any way to obtain that?

Thanks & regards.

share|improve this question
up vote 3 down vote accepted

I typed man top and read about top -i which displays non-idle, non-zombie processes.

share|improve this answer
thanks a lot! Thats exactly what I wanted! – magiza83 Oct 16 '12 at 14:45

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.