Linux system process management --- top--ps--kill

ps -aux

USER: which user generated the
process PID: process ID number
% CPU: the process occupies the percentage of CPU resources, the higher the occupancy, the more the process consumes resources
% MEM: the percentage of the process occupies physical memory, the higher the occupancy, the process The more resource-consuming
VSZ: the size of the virtual memory occupied by the process, in kb
RSS: the size of the actual physical memory occupied by the process, in kb
TTY: which terminal the process runs on

STAT: Process status R: Running S: Sleeping T: Stopping s: Containing child processes +: Located in the background

START: the start time of
the process TIME: the process takes up CPU time
COMMAND: the command name that generated the process

top View system health status
-d seconds: update every few seconds, default is 3 seconds

The first line of information is the task queue information
12:26:46 The current time of the system is
up 1 day 13:32 The running time of the system, the machine has been running for 1 day 13 hours and 32 minutes
2 users: currently logged in two users
load average: system After another 1 minute, 5 minutes, 15 minutes average load. It is generally considered that when it is less than 1, the load is small. If it is greater than 1, the system has exceeded the load. The
second line of process information
tasks: 101 total 1 running 100 sleeping 0 stopped 0 zombie
task number, the number of currently running processes of the system, running, sleeping, stop, zombie
CPU information
CPU (s) in the third line Cpu (s) : 0.1% us CPU percentage occupied by user mode
0.1% sy CPU percentage occupied by system mode
0.0% ni CPU percentage occupied by user process with changed priority
99.7% id idle CPU percentage of CPU
0.1% wa CPU waiting for input and output process Percentage
0.1% hi Percentage of soft interruption process
0.1% si Percentage of hard interruption The
fourth line of memory information
Mcm: Total physical memory size total How much used has been used and how much is left free How much is used for buffer buffer
fifth line exchange Partition information

pstree shows the process tree

-p also shows pid

kill -l
view available process signals

1 SIGHUP: let the signal shut down the process immediately, and then restart after reading the configuration file again
2 SIGINT: program termination signal, used to terminate the foreground process, equivalent to output ctrl + c shortcut key
8 SIGFPE: issued when a fatal arithmetic operation error occurs , Including floating-point arithmetic errors, overflows, and arithmetic errors with a divisor of 0
9 SIGKILL: used to immediately end the program. This signal cannot be blocked, processed, and ignored. It is generally used to forcefully terminate the process.
14 SIGALRM: clock timing signal, calculation Is the actual time or clock time, the alarm function uses this signal

15 SIGTERM: The signal that ends normally, the default signal of the kill command, sometimes the process fails to terminate the process normally. At this time, the SIGKILL signal should be used.
18 SIGCONT: This signal allows the suspended process to resume execution. This process cannot be blocked Break
19 SIGSTOP: This process can suspend the foreground process, which is equivalent to typing ctrl + z shortcut key. This signal cannot be blocked

kill -1 pid: restart a process
kill -9 pid: force kill a process

killall + process name kill all and name
pkill -9 -t + interrupt number to kick the current user out of the system

Command + &
ctrl + z put the process in the background

jobs View background jobs

fg% work number to resume the suspended work in the background to the foreground

Published 21 original articles · Likes0 · Visits 163

Guess you like

Origin blog.csdn.net/qq_45227330/article/details/105381437