Total Pageviews

Thursday 4 February 2016

killall: command not found的解决

我在vps中,选择安装了centos7,运行killall some_app,竟然提示killall: command not found。安装psmisc后,问题解决。
不过就算未装psmisc,其实用pkill some_app也可达到杀死some_app的进程的目的。

In this case there is the pkill command that will send a specified signal (or SIGTERM if not specified) to all processes that match the name (more options are available).
For example instead of:
killall badProcess

you can use:
pkill badProcess

which is also pretty easy and straightforward.


Another solution, would be of course to install it. If you have root access you can install the package psmisc using this command (in Ubuntu / Debian):
apt-get install psmisc

For RHEL – Red Hat / Fedora/centos:
yum install psmisc

This package contains the following useful programs:
fuser – identifies what processes are using files.
killall – kills a process by its name, similar to a pkill found in some other Unices.
pstree – Shows currently running processes in a tree format.
peekfd – Peek at file descriptors of running processes.