一、进程:
概念:正在运行的程序。
每个进程都有独立的ID号-PID,系统通过调用PID来操控进程。
系统的原始进程时init,init的进程号总是1,init进程如果中断,则系统就会崩溃。
一个进程可以产生另一个进程,除了init外。
进程树:
init─┬─acpid
├─atd
├─auditd─┬─python
│ └─{auditd}
├─automount───4*[{automount}]
├─avahi-daemon───avahi-daemon
├─crond
├─cupsd
├─dbus-daemon
├─events/0
├─gpm
├─hald───hald-runner─┬─hald-addon-acpi
│ ├─hald-addon-keyb
│ └─hald-addon-stor
├─hcid
├─hidd
├─hpiod
├─khelper
├─klogd
├─krfcommd
├─ksoftirqd/0
├─kthread─┬─aio/0
│ ├─ata/0
│ ├─ata_aux
│ ├─cqueue/0
│ ├─kacpid
│ ├─kauditd
│ ├─kblockd/0
│ ├─kgameportd
│ ├─khubd
│ ├─2*[kjournald]
│ ├─kmpathd/0
│ ├─kpsmoused
│ ├─kseriod
│ ├─kswapd0
│ ├─2*[pdflush]
│ └─scsi_eh_0
├─migration/0
├─6*[mingetty]
├─pcscd───{pcscd}
├─portmap
├─python
├─rpc.idmapd
├─rpc.statd
├─sdpd
├─2*[sendmail]
├─smartd
├─sshd───sshd───bash───pstree
├─syslogd
├─udevd
├─watchdog/0
├─xfs
├─xinetd
└─yum-updatesd
进程列表
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.2 2044 632 ? Ss Oct30 0:00 init [3]
root 2 0.0 0.0 0 0 ? S Oct30 0:00 [migration/0]
root 3 0.0 0.0 0 0 ? SN Oct30 0:00 [ksoftirqd/0]
root 4 0.0 0.0 0 0 ? S Oct30 0:00 [watchdog/0]
root 5 0.0 0.0 0 0 ? S< Oct30 0:00 [events/0]
root 6 0.0 0.0 0 0 ? S< Oct30 0:00 [khelper]
root 7 0.0 0.0 0 0 ? S< Oct30 0:00 [kthread]
root 10 0.0 0.0 0 0 ? S< Oct30 0:00 [kblockd/0]
root 11 0.0 0.0 0 0 ? S< Oct30 0:00 [kacpid]
root 68 0.0 0.0 0 0 ? S< Oct30 0:00 [cqueue/0]
USER:
进程名
PID:
进程
ID
%CPU:
占用
CPU
的百分比
%MEM:
占用内存的百分比
TTY:进程所在的终端,为
“
?
”
说明不是在终端中运行
STAT:进程装态: R 正在运行
S 进程睡眠中,通常可以因事件发生而被唤醒
T 进程已停止
D 进程睡眠中,除非发生事件否则不会被唤醒(不间断睡眠)
Z 僵尸进程,例如未能被父进程回收的子进程。通常时一个bug或非法操作。
< 高优先级进程
N 低优先级进程
l 线程
+ 位于后台的进程
s 表示还有子进程
START:进程开始时间
TIME:进程运行时间
COMMAND:进程命令参数