Limit process number in TOP command outupt | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Limit process number in TOP command outupt

UNIX for Dummies Questions & Answers


Tags
limit, lines, process, top

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-03-2012
vikram3.r vikram3.r is offline
Registered User
 
Join Date: Oct 2009
Last Activity: 23 October 2013, 10:24 AM EDT
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
Limit process number in TOP command outupt

Linux top command prints more than 40 processes.

Code:
top -b -n 1 > Top_Output.txt

Is there a straight-forward option/way to limit only till the top 5 processes.

( Instead of using head, tail or other unix commands together)

Last edited by vbe; 12-03-2012 at 09:35 AM.. Reason: Do you mind using code tags!
Sponsored Links
    #2  
Old 12-03-2012
hombreopaco's Avatar
hombreopaco hombreopaco is offline
Registered User
 
Join Date: Sep 2011
Last Activity: 30 May 2014, 11:57 AM EDT
Posts: 19
Thanks: 0
Thanked 4 Times in 4 Posts
This is the solution:

Code:
top -b 5 -n 1

In any way:

top [N] where N is the number of the process, any other number after -n will be used as count number.

Last edited by vbe; 12-03-2012 at 09:35 AM..
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Using top command to email if process is exceeding 25% and sending an email alert if so jay02 Shell Programming and Scripting 8 03-02-2012 11:36 AM
Top command in AIX 4.2 (no topas, no nmon, no top)? Browser_ice AIX 1 07-04-2009 07:00 PM
Command to find TOP 5 Memory consuming process bce_groups AIX 4 05-07-2009 05:09 PM
Number of long limit herath UNIX for Dummies Questions & Answers 2 06-03-2008 02:31 AM
Xargs command outupt to file byblos Shell Programming and Scripting 3 11-09-2007 11:34 AM



All times are GMT -4. The time now is 04:00 PM.