如何在bash中杀死进程?

时间:2015-05-30 05:11:39

标签: bash process kill

我使用了以下bash代码:

for pid in `top -n 1 | awk '{if($8 == "R") print $1;}'`
do
  kill $pid
done

它说:

./kill.sh: line 3: kill: 29162: arguments must be process or job IDs
./kill.sh: line 3: kill: 29165: arguments must be process or job IDs
./kill.sh: line 3: kill: 29166: arguments must be process or job IDs
./kill.sh: line 3: kill: 29169: arguments must be process or job IDs

有什么想法吗?谢谢!

0 个答案:

没有答案