1. Multi-u multi-core CPU monitoring
In the top basic view, press the keypad number "1" to monitor the status of each logical CPU:
650) this.width=650; "width=" 581 "height=" 419 "src=" http://files.jb51.net/file_images/article/201404/ 201404091709191.jpg "style=" border:1px solid rgb (204,204,204); vertical-align:bottom;padding:1px;/>
Observe that the server has 16 logical CPUs, which are actually 4 physical CPUs. Press the number key 1 again to return to the top basic view interface.
2. Highlight the current running process
Tap the keyboard "B" (Turn on/off the highlight effect) and the top view changes as follows:
650) this.width=650; "Width=" 555 "height=" 202 "src=" http://files.jb51.net/file_images/article/201404/ 201404091709192.png "style=" border:1px solid rgb (204,204,204); vertical-align:bottom;padding:1px;/>
We found that the "top" process with process ID 2570 was highlighted, and the top process was the only running state (runing) that was shown in the second row of the view, and you could turn off or turn on the highlight of the running process by tapping the "Y" key.
3. Process field Sorting
By default, when Top is reached, the processes are sorted according to CPU consumption, with the process ID 28894 of the Java process First (CPU 142%), and the process ID 574 Java process second (CPU occupied 16%).
650) this.width=650; "Width=" 539 "height=" 149 "src=" http://files.jb51.net/file_images/article/201404/ 201404091709193.png "style=" border:1px solid rgb (204,204,204); vertical-align:bottom;padding:1px;/>
Tap the keyboard "X" (The highlight effect on/off the row sequence), and the top view changes as follows:
650) this.width=650; "Width=" 520 "height=" 166 "src=" http://files.jb51.net/file_images/article/201404/ 201404091709194.png "style=" border:1px solid rgb (204,204,204); vertical-align:bottom;padding:1px;/>
As you can see, the top default sort column is "%cpu".
4. You can change the column to the right or left by using "SHIFT + >" or "Shift + <"
is to press SHIFT + > once, the view is now sorted by%mem.
650) this.width=650; "Width=" 555 "height=" 163 "src=" http://files.jb51.net/file_images/article/201404/2014 04091709195.png "style=" border:1px solid rgb (204,204,204); vertical-align:bottom;padding:1px;/>
Example 2: Show full command
Command: Top-c
Output:
650) this.width=650; "Width=" 555 "height=" src= "http://files.jb51.net/file_images/article/201404/" 201404091709196.png "style=" border:1px solid rgb (204,204,204); vertical-align:bottom;padding:1px;/>
Example 3: Displaying program information in batch mode
Command: Top-b
Example 4: Displaying program information in cumulative mode
Command: Top-s
Example 5: Set Information update times
Command: Top-n 2
Description: Indicates update two times after the update display is terminated
Example 6: Set Information update time
Command: top-d 3
Description: Indicates an update period of 3 seconds
Example 7: Displaying the specified process information
Command: Top-p 574
Output:
650) this.width=650; "Width=" 555 "height=" 145 "src=" http://files.jb51.net/file_images/article/201404/ 201404091709197.png "style=" border:1px solid rgb (204,204,204); vertical-align:bottom;padding:1px;/>
5.top Interactive Commands
Some of the interactive commands that you can use during the top command execution. These commands are single-letter, and some of these commands may be masked if the S option is used on the command line.
H Display the help screen and give some brief command summary instructions
K Terminates a process.
I ignore idle and zombie processes. This is a switch-type command.
Q Exit Program
R reschedule a process's priority level
S Switch to cumulative mode
s change the delay time between two refreshes (in units of s), and if there are decimals, convert to M S. Enter 0 value and the system will refresh continuously, the default value is 5 s
F or F Add or remove items from the current display
O or O change the order in which items are displayed
L Toggle display of average load and start-up time information
M Toggle Display Memory Information
T toggle display of process and CPU status information
C Toggle Display command name and full command line
M sort based on resident memory size
P Sort by percentage of CPU usage
T Sort by Time/cumulative time
W writes the current settings to the ~/.TOPRC file
Linux Top Usage Tips