Linux系統
殺進程
# 運用cut
ps -ef | grep firefox | grep -v grep | cut -c 9-15 | xargs kill -s 9
# 運用pgrep
pgrep firefox | xargs kill -s 9
# 運用pidof
pidof firefox-bin | xargs kill -s 9
# 運用awk
ps -ef | grep firefox | grep -v grep | awk '{print $2}' | xargs kill -9
# 運用pkill
pkill -9 firefox
# 運用killall
killall -9 firefox
殺終端
who
# 輸出裏查看全部用戶
root pts/0 2017-01-20 11:38 (10.169.108.89)
root pts/1 2017-01-20 11:06 (10.169.108.89)
w -f
# 輸出裏查看全部用戶的行爲
11:23:16 up 3 days, 16:53, 2 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/1 10.169.108.89 11:06 0.00s 0.03s 0.00s w -f
root pts/2 10.169.108.89 11:08 1:49 0.06s 0.06s -bash
who am i
# 輸出當前登陸的用戶
root pts/1 2017-01-20 11:06 (10.169.108.89)
pkill -9 -t pts/2 # 殺掉其餘用戶所屬終端
Windows系統
殺進程
rem 官方有詳細用法
TASKKILL /?