Re: limit number of process in top with non-interactive mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thats right Marshall, infact I did think of 
top -n1 -b | head -<number>
 but did not like and thought that there would be something which can be 
done with top itself with out taking any other help like pipe ..
 Regards,
Nikhil


On 9/9/05, McDougall, Marshall (FSH) <MarMcDouga@xxxxxxxxx> wrote: 
> 
> -----Original Message-----
> From: redhat-list-bounces@xxxxxxxxxx
> [mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of mnikhil m
> Sent: Friday, September 09, 2005 5:14 AM
> To: General Red Hat Linux discussion list
> Subject: limit number of process in top with non-interactive mode
> 
> 
> Top command in Linux is allowing to control the number of processes only
> in
> the
> interactive mode. I want to control the number of processes in
> non-interactive batch
> mode. Is there any other version of top available ? Or is there a way to
> do
> so with
> the current version itself?
> 
> Note: Manual page for top is inappropriate with the command.
> For example, "top 10" reports an improper use of command though it is
> valid
> according to the man page.
> [Actually this is asked by one of my colleague, asking here as I am out
> of
> answer]
> Regards,
> Nikhil
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=subscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
> 
> 
> If you are looking to do it non-interactively, just add a couple more
> lines to your batch job to get the desired outcome. I am not the best
> scripter, but something like:
> 
> Top -b -n 1 > /tmp/top.txt
> Head -n 22 /tmp/top.txt > /tmp/top2.txt
> 
> This gives me all the top header info and the first 10 processes. I
> know it's not pretty, but you get the idea.
> 
> Regards, Marshall
>
-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subjecthttps://www.redhat.com/mailman/listinfo/redhat-list


[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux