ps命令可以用来查看现在运行在系统中的进程,可以看到PID, TTY, TIME,CMD四项内容。
ps aux | less
上面命令将进程列表在less中打开,aux分别代表:
a = show processes for all users
u = display the process's user/owner
x = also show processes not attached to a terminal
在命令的输出里,有一列STAT,表示进程的状态,共有五种:
State | |
D | Uninterruptible sleep |
R | Running |
S | Interruptible sleep |
T | stopped |
z | Defunct ('zombie') |