Pages

Thursday, June 1, 2017

Find Top 15 Processes by Memory Usage with ‘top’ in Batch Mode

Similarly to the previous tip about find out top processes by RAM and CPU usage, you can also use top command to view the same information. Perhaps there’s an extra advantage of this approach when compared to the previous one: the “header” of top provides extra information about the current status and usage of the system: the uptime, load average, and total number of processes, to name a few examples.

Find Processes By Memory Usage with top
Find Processes By Memory Usage with top
To display the top 15 processes sorted by memory use in descending order, do:
# top -b -o +%MEM | head -n 22
As opposed to the previous tip, here you have to use +%MEM (note the plus sign) to sort the output in descending order:
List Top 15 Processes By Memory Usage
List Top 15 Processes By Memory Usage
From the command above, the option:
  1. -b : runs top in batch mode
  2. -o : used to specify fields for sorting processes
  3. head utility displays the first few lines of a file and
  4. the -n option is used to specify the number of lines to be displayed.
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
                                                    ► Read more: http://adf.ly/1n5XLw
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

No comments:

Post a Comment