Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I do 'top', I learn that there are many processes running out of which many are in sleep state. I need to see complete snapshot of all processes at that point. the 'top' is able to show listing of processes, which fit in one screen.How do I get complete listing?

Among other things, I am interested in seeing list of all processes, which are in "sleeping" state. I don't think, I can get process state in output of "ps" command

share|improve this question
1  
See if you have htop. Its process list is scrollable. –  manatwork Apr 11 '12 at 12:13

2 Answers 2

top -b seems to be doing the trick.

share|improve this answer
    
Adding -n1 option will gives one full page then exit. –  enzotib Apr 11 '12 at 13:03
    
Unfortunately this does not allow interactive operation. –  Ciro Santilli Jul 14 at 11:42

You can get process states with coreutils ps

$ ps aux

will list all that, and more. Here's how you can decode them, from the man page:

PROCESS STATE CODES

Here are the different values that the s, stat and state output specifiers (header "STAT" or "S") will display to describe the state of a process:

   D    uninterruptible sleep (usually IO)
   R    running or runnable (on run queue)
   S    interruptible sleep (waiting for an event to complete)
   T    stopped, either by a job control signal or because it is being traced.
   W    paging (not valid since the 2.6.xx kernel)
   X    dead (should never be seen)
   Z    defunct ("zombie") process, terminated but not reaped by its parent.

For BSD formats and when the stat keyword is used, additional characters may be displayed:

   <    high-priority (not nice to other users)
   N    low-priority (nice to other users)
   L    has pages locked into memory (for real-time and custom IO)
   s    is a session leader
   l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
   +    is in the foreground process group.
share|improve this answer

Your Answer

 
discard

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.