[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

Change the sort order using the top command, which is essential for checking the CPU load!

My name is Ito and I am an infrastructure engineer.

The top command is often used when the CPU load is high.
If you look closely, the processes with high CPU will be at the top.

However, in some cases, you may want to order processes other than CPU.

This time, we will show you how to change the sort order using the top command!

*If you would like to review how to use the top command, click here

How to change the sort order

Sort type

There are three types of sorting methods that we will introduce here.

shift key + m
shift key + p
shift key + o

use shift key

You can sort by combining the sfift key with "m" or "p".

shift+m Sort by memory usage
shift+p Sort by CPU usage (default)

It will look like this

・shift+m
shift-m_

・shift+p (default)
shift-p_

If you want to sort more finely

Of course, there will be other items you want to sort besides memory and CPU.
In such a case, "shift+o" .

The screen will look like this.

k

On this screen, simply select the alphabet of the item you want to sort and press the Enter key. easy!

By default, the list is sorted by CPU usage, so "K" is selected. (Indicated by an asterisk)
Let's look at each PID.

You'll notice that when you type "a", the PID is selected and the lowercase "a" is changed to an uppercase "A".

a_

Now press Enter. . .

sort-pid_

You can now sort by PID!
The ones that are actually often used are RES (q) and Status (w).

bonus

By the way, if you press "f" in the top command, you can add more fields to the screen like shift+o!

f

I tried to calculate the capacity of SWAP.

swap_

top is the first command you use when something happens to the server.
I hope you remember this article when you are concerned about something other than the CPU!

If you want to consult a cloud professional

At Beyond, we use the technical capabilities we have cultivated as a multi-cloud integrator and managed service provider (MSP) since our founding to design, build, and migrate using various cloud/server platforms such as AWS, GCP, Azure, and Oracle Cloud. I went there.

We provide custom-made cloud/server environments that are optimized for customers according to the specifications and functions of the systems and applications they require, so if you are interested in the cloud, please feel free to contact us. .

● Cloud/server design/construction
● Cloud/server migration/migration
● Cloud/server operation, maintenance, and monitoring (24 hours a day, 365 days a year)

If you found this article helpful , please give it a like!
7
Loading...
7 votes, average: 1.00 / 17
74,021
X facebook Hatena Bookmark pocket
[Webinar] Introduction to Multi-Cloud: Which cloud is best for your business? Get the latest information on the 8 major clouds!

[Webinar] Introduction to Multi-Cloud: Which cloud is best for your business? Get the latest information on the 8 major clouds!

[Webinar] From the operational structure to specific steps! A complete overview of cloud server operation and maintenance

[Webinar] From the operational structure to specific steps! A complete overview of cloud server operation and maintenance

The person who wrote this article

About the author