View the top 10 processes for native CPU and memory utilization

Source: Internet
Author: User
Tags cpu usage

In daily operations, it is often time to look at the number of processes that occupy the current system CPU or memory usage. These view commands are listed below:

See the 5 most CPU-intensive processes
PS aux | Sort-k3rn | Head-5
Or
Top (then press p, note uppercase, CPU usage descending)

View the top 5 processes that occupy memory
PS aux | SORT-K4RN | Head-5
Or
Top (then press m, note uppercase, memory utilization descending)

View all information using commands
PS aux


Sort-rn Descending
Sort-k3rn in descending order of the third column

Sort|uniq sort to go heavy
Sort|uniq-c Number of print repetitions
sort|uniq-d part of the print intersection
Sort|uniq-u Print the part that removes the intersection

Example:

[email protected] ~]# Cat A
Sdfasasdf
2
3
4
asdfasf
Asdfsdfasdfasdf


[email protected] ~]# Cat B
adfasf1231
2
3
sdf435
4


[Email protected] ~]# cat a B|sort|uniq
2
3
4
adfasf1231
asdfasf
Asdfsdfasdfasdf
sdf435
Sdfasasdf
[Email protected] ~]# cat a b|sort|uniq-c
2 2
2 3
2 4
1 adfasf1231
1 asdfasf
1 ASDFSDFASDFASDF
1 sdf435
1 SDFASASDF
[Email protected] ~]# cat a b|sort|uniq-d
2
3
4
[Email protected] ~]# cat a b|sort|uniq-u
adfasf1231
asdfasf
Asdfsdfasdfasdf
sdf435
Sdfasasdf

View the top 10 processes for native CPU and memory utilization

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.