进程管理器

#!/bin/bash
#进程管理器
# Author : suiang

process=$(ps -u $USER | yad --title="进程管理器" --list --column="请选择需要结束的 进程:" --text="列出用户:$USER 下所有进程:" --button="取消:1" --button="结束进程:0" --width=450 --height=400)

ret=$?

[[ $ret -eq 1 ]] && exit 0

if [[ $ret -eq 0 ]]; then
   pid=`echo $process | cut -d" " -f1`
   kill $pid
   ans=$?
   if [ "$ans" = "0" ]; then 
   proc=`echo $process | cut -d"|" -f1 | cut -d" " -f4`
   notify-send -h int:transient:1 -t 3000 -u normal --icon=dialog-ok "进程管理器" "结束进程:$proc PID:$pid 成功"
   else
   notify-send -h int:transient:1 -t 3000 -u normal --icon=dialog-error "进程管理器" "错误:没有发现进程:$proc PID:$pid"
   fi
exit 0
fi

QQ截图20131105113241.png

自力更生,消灭零回复 :4_89:

做的更完善一点,过滤下用户进程和系统进程可以吗?

我记得原来在12.04的时候,软件中心曾经有一款终端图形界面的进程管理软件,现在找不到了。。。也忘了名字了。。。

厉害

名字叫 系统监视器

yad是个啥命令,求lz给个注释说明啥的,让我们学习学习:lol

好厉害,不明觉厉:6_126:先收藏着,慢慢啃~~~