Top command usage
The top command can be used to conveniently observe the information of processes running in the current system, and perform operations such as changing the priority of processes, changing sorting rules, and exporting status information during running, very convenient.
1. Main options
-D: the number of seconds to be followed, and the number of seconds to update the status. The default value is 5 seconds.
-B: Run top in batches. Usually, the top output is redirected to the file through redirection.
-N: used in combination with-B to run top times
-P: PID of the observed process
2. Key commands that can be used during top execution:
? : Display in top, you can enter the key command
P: sorted by CPU utilization;
M: Display by memory utilization;
N: sort by PID!
T: The cpu time accumulation (TIME +) used by the process is sorted.
K: Give a PID a signal (signal)
R: specify a nice value for a PID.
Q: Exit top.
3. Example
$ Top-d 2 // update the running status every 2 seconds
$ Top-B-n 2> ~ /Tmp/top.txt // export the status information of two running tasks to a file.
$ Top-d 2-p 1425 // updates the running status of the specified process every 2 seconds
Linux top commands
Linux top commands
Linux top commands for monitoring and diagnosis tools
Top command causes system load increase
Practical top Command
Why does Linux's htop command win the top command?
Use the most powerful process monitor htop in Ubuntu
This article permanently updates the link address: