2019-07-23 15:54:26 +00:00
|
|
|
### PROCESS
|
|
|
|
# mnemonic: [K]ill [P]rocess
|
|
|
|
# show output of "ps -ef", use [tab] to select one or multiple entries
|
2019-08-26 18:21:50 +00:00
|
|
|
# press [enter] to kill selected processes
|
|
|
|
# press [escape] to exit
|
2019-07-23 15:54:26 +00:00
|
|
|
|
2019-08-26 18:21:50 +00:00
|
|
|
pid=$(ps -ef | sed 1d | eval "fzf ${FZF_DEFAULT_OPTS} -m --header='[process:kill]'" | awk '{print $2}')
|
2019-07-23 15:54:26 +00:00
|
|
|
|
|
|
|
if [ "x$pid" != "x" ]
|
|
|
|
then
|
|
|
|
echo $pid | xargs kill -${1:-9}
|
|
|
|
fi
|