LoginSignup
7
6

More than 5 years have passed since last update.

残ってしまったプロセスを名前から複数探してkillするスクリプト

Posted at

たまにNode.jsのプロセスだけ残してしまって、プロセスを自前で何個もkillしていることがあったので面倒になりました。シェルはそんなに書かないのですが、調べてこんな風に書いています。

#!/bin/sh
kill `ps aux | grep node | egrep -v grep | awk '{print $2}'`

下記参照しました。ありがとうございます。
http://www.syboos.jp/linux/doc/kill-process-from-process-name.html

7
6
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6