0
top -bHn 1 -u mail

I've read through the man pages and there seems to be some stuff there that is not included in them. Pointing me to additional documentation would be helpful too. In particular, I'm not sure what the 1 is doing or mail. Thanks!

1

From man top

   -b : Batch mode operation
        Starts top in 'Batch mode', which could be useful for sending
        output from top to other programs or  to  a  file.   In  this
        mode, top will not accept input and runs until the iterations
        limit you've set with the '-n' command-line option  or  until
        killed.

   -H : Threads toggle
        Starts top with the last remembered 'H' state reversed.  When
        this  toggle is On, all individual threads will be displayed.
        Otherwise, top displays a  summation  of  all  threads  in  a
        process.

   -n : Number of iterations limit as:  -n number
        Specifies  the  maximum  number of iterations, or frames, top
        should produce before ending.

   -u : Monitor by user as:  -u somebody
        Monitor only processes with an effective  UID  or  user  name
        matching that given.

So it means operate in batch mode (-b), toggle thread display (-H), for a single iteration (-n 1), showing only processes belonging to user mail (-u mail) : basically an one-time snapshot of the current threads belonging to mail, more or less equivalent to ps -Lfu mail

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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