Answers:
killall nameofexefile.exe
就像linux进程
好吧,作为一名葡萄酒程序员,我经常会想尽全力,所以我使用了超级特殊的killwine脚本。这是一个很难的死(这是wineserver -k
很好的方式,并且始终是首选)。
#!/bin/bash
wine_cellar="${HOME}/.local/share/wine"
if (($#)); then
if [[ -e "${wine_cellar}/$1" ]]; then
WINEPREFIX="${wine_cellar}/$1"
shift
elif [[ "${1:0:1}" != "-" ]]; then
echo "ERROR: Didn't understand argument '$1'?" >&2;
exit 1
fi
fi
if ((${#WINEPREFIX})); then
pids=$(
grep -l "WINEPREFIX=${WINEPREFIX}$" $(
ls -l /proc/*/exe 2>/dev/null |
grep -E 'wine(64)?-preloader|wineserver' |
perl -pe 's;^.*/proc/(\d+)/exe.*$;/proc/$1/environ;g;'
) 2> /dev/null |
perl -pe 's;^/proc/(\d+)/environ.*$;$1;g;'
)
else
pids=$(
ls -l /proc/*/exe 2>/dev/null |
grep -E 'wine(64)?-preloader|wineserver' |
perl -pe 's;^.*/proc/(\d+)/exe.*$;$1;g;'
)
fi
if ((${#pids})); then
set -x
kill $* $pids
fi
假设您的葡萄酒前缀在之下~/.local/share/wine
。用法示例为:
killwine # Just kill all instances of wine
killwine -9 # Hard kill them all
killwine lotro # Only kill wine under ${HOME}/.local/share/wine/lotro
killwine -INT lotro # Same as above, but use SIGINT
WINEPREFIX=/tmp/crap killwine # Kill only the instance under /tmp/crap
sudo reboot # Pretend you're running windows.
我不知道,但是我不认为您通常会在正常甚至普通+分期发行版中最终挂在内存中的各种进程(此脚本负责处理),但是我做很多事情是因为入侵服务器和ntdll。
编辑:此脚本将仅在基于Linux的操作系统上工作,并假定proc文件系统安装在/ proc等上。
我的版本:
ls -l /proc/*/exe 2>/dev/null | grep -E 'wine(64)?-preloader|wineserver' | perl -pe 's;^.*/proc/(\d+)/exe.*$;$1;g;' | xargs -n 1 kill
它杀死了所有葡萄酒过程。感谢这篇文章/ubuntu//a/732320/605355