linux命令学习之结束进程
- Kill命令:
- kill用来终止一个进程
- 格式:
- kill [ -s signal | -p ] [ -a ] pid...
- 格式:
-s:指定发送的信号。
-p:模拟发送信号。
-l:指定信号的名称列表。
pid:要中止进程的ID号。
- --------------------------------------------------------------------------------------------------
- pgrep命令:
- --------------------------------------------------------------------------------------------------
pgrep -lo httpd列出最早启动的apache进程ID;
- -------------------------------------------------------------------------------------------------------
- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- kill -s 9 `ps aux | grep -w program_name | grep -v grep | awk '{print $2}'`
- 方法二:
1.获得进程ID
pgrep -f program_name
或
ps -ef | grep program_name
2.杀掉进程
kill -s 9 pid
方法三:
kill -s 9 'pgrep -f program_name'
方法四:
pkill -9 program_name'
相关推荐
qiupu 2020-11-04
多读书读好书 2020-11-03
RedCode 2020-10-28
jiedinghui 2020-10-25
Ladyseven 2020-10-22
hellowzm 2020-10-12
zuncle 2020-09-28
Ladyseven 2020-09-11
jiedinghui 2020-09-07
xiaohuli 2020-09-02
葉無聞 2020-09-01
impress 2020-08-26
ThikHome 2020-08-24
nicepainkiller 2020-08-20
hellowzm 2020-08-18