杀掉所有用户进程,保留当前进程: killall5

本想打算自己造个轮子。发现linux已经有一个圆轮子了


KILLALL5(8)                                                                           Linux System Administrator's Manual                                                                          KILLALL5(8)

NAME
       killall5 -- send a signal to all processes.

SYNOPSIS
       killall5 -signalnumber [-o omitpid[,omitpid..]]  [-o omitpid[,omitpid..]..]

DESCRIPTION
       killall5  is  the  SystemV killall command. It sends a signal to all processes except kernel threads and the processes in its own session, so it won't kill the shell that is running the script it was
       called from. Its primary (only) use is in the rc scripts found in the /etc/init.d directory.

OPTIONS
       -o omitpid
              Tells killall5 to omit processes with that process id.

NOTES
       killall5 can also be invoked as pidof, which is simply a (symbolic) link to the killall5 program.

EXIT STATUS
       The program return zero if it killed processes.  It return 2 if no process were killed, and 1 if it was unable to find any processes (/proc/ is missing).

SEE ALSO
       halt(8), reboot(8), pidof(8)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值