|
需要了解进程的状态:R S T Z
R: 真正在CPU中分时
S: 自旋
T: kill -19 (Ctrl+z)
重新执行: kill -18 (bg )
彻底杀死进程kill -9 (Ctrl+c)
- [root@classroom ~]# ps aux | grep sleep
- root 28810 0.0 0.0 220000 720 pts/0 S+ 20:18 0:00 sleep 3000
- root 28819 0.0 0.0 220000 728 ? S 20:18 0:00 sleep 60
- root 28863 0.0 0.0 220000 836 ? S 20:18 0:00 /bin/sleep 10
- root 28865 0.0 0.0 224856 1112 pts/2 S+ 20:18 0:00 grep --color=auto sleep
- [root@classroom ~]# kill -19 28810
- [root@classroom ~]# ps aux | grep sleep
- root 28810 0.0 0.0 220000 720 pts/0 T 20:18 0:00 sleep 3000
- root 29116 0.0 0.0 220000 720 ? S 20:22 0:00 sleep 60
- root 29119 0.0 0.0 220000 824 ? S 20:22 0:00 /bin/sleep 10
- root 29121 0.0 0.0 224856 1084 pts/2 S+ 20:22 0:00 grep --color=auto sleep
复制代码- [root@classroom ~]# sleep 3000
- [1]+ 已停止 sleep 3000
- [root@classroom ~]# jobs
- [1]+ 已停止 sleep 3000
- [root@classroom ~]#
复制代码- [root@classroom ~]# kill -18 28810
- [root@classroom ~]# ps aux | grep sleep
- root 28810 0.0 0.0 220000 720 pts/0 S 20:18 0:00 sleep 3000
- root 29306 0.0 0.0 220000 804 ? S 20:25 0:00 sleep 60
- root 29426 0.0 0.0 220000 804 ? S 20:25 0:00 /bin/sleep 10
- root 29428 0.0 0.0 224856 1056 pts/2 S+ 20:25 0:00 grep --color=auto sleep
复制代码- [root@classroom ~]# jobs
- [1]+ 运行中 sleep 3000 &
- [root@classroom ~]#
复制代码- ps axo pid,ppid,command,nice,%cpu,%mem --sort %cpu
复制代码
|
|