A process is an entity that a program runs, and a child process (thread) under a process.Process StatisticsTo start the process statistics, you must first prepare the Accton recorded files
touch /var/log/pacct #创建记录所用的文件
accton /var/log/pacct #激活accton
accton #关闭accton
lastcomm -f /var/log/pacct #查看进程统计记录的文件
The background runs a task that takes a long time to run, put it in the background to run it so that you can enter a command to run after using the shortcut key CTRL + Z use jobs to view the background process queue and put the background suspended process back into the foreground executionFG 1
To view the currently running process, you can use PS aux to view the status of the process
[[email protected] ~]$ ps
PID TTY TIME CMD
2064 pts/200:00:00 bash
2122 pts/200:00:00 ping
2123 pts/200:00:00 ps
Process State tree
[[email protected] ~]$ pstree
init─┬─NetworkManager
├─abrtd
├─acpid
├─atd
├─auditd───{auditd}
├─automount───4*[{automount}]
├─certmonger
├─crond
├─cupsd
├─dbus-daemon───{dbus-daemon}
├─hald─┬─hald-runner─┬─hald-addon-acpi
││└─hald-addon-inpu
│└─{hald}
├─master─┬─pickup
│└─qmgr
├─6*[mingetty]
├─modem-manager
├─ntpd
├─2*[ping]
├─rhsmcertd
├─rpc.statd
├─rpcbind
├─rsyslogd───3*[{rsyslogd}]
├─sshd───sshd───sshd───bash─┬─ping
│└─pstree
├─udevd───2*[udevd]
└─wpa_supplicant
Shows that the difference between PS and top is that top can dynamically show the progress of the processKill Process
kill 进程号
#如终止后台的ping进程
[[email protected] ~]$ ps
PID TTY TIME CMD
2064 pts/200:00:00 bash
2122 pts/200:00:00 ping
2168 pts/200:00:00 ps
[[email protected] ~]$ kill 2122
Kill the foreground process using CTRL + C to find the process
pgrep -l sshd #查询ssh的进程
From for notes (Wiz)
#6. Process Management for Linux