<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: running 'top' command in batch mode in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/running-top-command-in-batch-mode/m-p/4595991#M39980</link>
    <description>Another alternative is to run collectl - think sar on steroids.  It will collectl just about everything about you system, including process data, which you can then play back later.&lt;BR /&gt;&lt;BR /&gt;It has a --top switch which will play back process data in a format similar to 'top' which  by default will show the top 10 consumers of CPU for each sample period which is a minute.  You can even tell it to sort of things like memory, I/O, etc and can change the number of processes reported and/or the sample period at collection time.&lt;BR /&gt;&lt;BR /&gt;-mark&lt;BR /&gt;</description>
    <pubDate>Sun, 18 Apr 2010 10:22:22 GMT</pubDate>
    <dc:creator>MarkSeger</dc:creator>
    <dc:date>2010-04-18T10:22:22Z</dc:date>
    <item>
      <title>running 'top' command in batch mode</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-top-command-in-batch-mode/m-p/4595987#M39976</link>
      <description>I didn't get an answer in the linux section of this forum, so posting it here ... anyway know the answer to this?&lt;BR /&gt;-----------&lt;BR /&gt;I am trying to run the top command in batch mode and would like to sort that on either the RES field or VIRT field, how do I do that?&lt;BR /&gt;&lt;BR /&gt;What is the switch to sort any field in batch mode?&lt;BR /&gt;# top -b -n 1</description>
      <pubDate>Fri, 05 Mar 2010 22:55:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-top-command-in-batch-mode/m-p/4595987#M39976</guid>
      <dc:creator>Shabu Khan-2</dc:creator>
      <dc:date>2010-03-05T22:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: running 'top' command in batch mode</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-top-command-in-batch-mode/m-p/4595988#M39977</link>
      <description>&amp;gt;I didn't get an answer in the linux section&lt;BR /&gt;&lt;BR /&gt;HP-UX is different.  There is no -b.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;would like to sort that on either the RES field or VIRT field, how do I do that?&lt;BR /&gt;&lt;BR /&gt;You'll have to strip off the header and use sort -k.&lt;BR /&gt;Perhaps it would be using to use ps(1) and sort on its fields?</description>
      <pubDate>Fri, 05 Mar 2010 23:45:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-top-command-in-batch-mode/m-p/4595988#M39977</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-03-05T23:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: running 'top' command in batch mode</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-top-command-in-batch-mode/m-p/4595989#M39978</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Even looking at the GNU/Linux 'top' command manpages indicates to me that you need to roll-your-own if you are running in batch mode.  You might do something along these lines:&lt;BR /&gt;&lt;BR /&gt;# top -b -n 1|awk '{if ($1~/[0-9]+/) {if ($5~/m/) {$5=int($5*1024*1024)};print}}'|sort -k5rn,5&lt;BR /&gt;&lt;BR /&gt;This stripes the header liness (since they don't have a numeric first field.  If the VIRT field units are "m"egabytes, then this field is scaled to match the other values in this column.  You might need additional code for other scaling.  The output is then piped to 'sort' and shown in descending size order.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF... &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Mar 2010 23:49:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-top-command-in-batch-mode/m-p/4595989#M39978</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-03-05T23:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: running 'top' command in batch mode</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-top-command-in-batch-mode/m-p/4595990#M39979</link>
      <description>Thanks JRF.&lt;BR /&gt;Thats exactly what I need.&lt;BR /&gt;&lt;BR /&gt;Thanks for the responses guys.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shabu</description>
      <pubDate>Sat, 06 Mar 2010 00:02:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-top-command-in-batch-mode/m-p/4595990#M39979</guid>
      <dc:creator>Shabu Khan-2</dc:creator>
      <dc:date>2010-03-06T00:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: running 'top' command in batch mode</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-top-command-in-batch-mode/m-p/4595991#M39980</link>
      <description>Another alternative is to run collectl - think sar on steroids.  It will collectl just about everything about you system, including process data, which you can then play back later.&lt;BR /&gt;&lt;BR /&gt;It has a --top switch which will play back process data in a format similar to 'top' which  by default will show the top 10 consumers of CPU for each sample period which is a minute.  You can even tell it to sort of things like memory, I/O, etc and can change the number of processes reported and/or the sample period at collection time.&lt;BR /&gt;&lt;BR /&gt;-mark&lt;BR /&gt;</description>
      <pubDate>Sun, 18 Apr 2010 10:22:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-top-command-in-batch-mode/m-p/4595991#M39980</guid>
      <dc:creator>MarkSeger</dc:creator>
      <dc:date>2010-04-18T10:22:22Z</dc:date>
    </item>
  </channel>
</rss>

