1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > 从Ubuntu命令行按进程名称杀死进程

从Ubuntu命令行按进程名称杀死进程

时间:2021-03-29 15:45:48

相关推荐

从Ubuntu命令行按进程名称杀死进程

There are a number of ways to kill a process if you know the name of the process. Here’s a couple different ways you can accomplish this. We are going to assume that the process we are trying to kill is namedirssi

如果您知道进程的名称,则有多种方法可以杀死该进程。 您可以通过以下两种不同的方法来完成此操作。 我们将假设我们要杀死的进程名为irssi

kill $(pgrep irssi)

杀死$(pgrep irssi)

killall -v irssi

Killall -v irssi

pkill irssi

菲尔·伊尔西

kill `ps -ef | grep irssi | grep -v grep | awk ‘{print $2}’`

杀死`ps -ef | grep irssi | grep -v grep | awk'{print $ 2}'`

These techniques can be useful in shell scripts, where you wouldn’t know the process ID and would need to restart or kill a process.

这些技术在Shell脚本中非常有用,因为您不知道进程ID,因此需要重新启动或终止进程。

翻译自: /howto/ubuntu/kill-a-process-by-process-name-from-ubuntu-command-line/

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。