如何轻轻地杀死Linux / OS X上的Firefox进程 [英] How to gently kill Firefox process on Linux/OS X

查看:634
本文介绍了如何轻轻地杀死Linux / OS X上的Firefox进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Firefox做一些自动化操作,虽然我可以从shell打开Firefox窗口,但我无法正确终止它。如果我 kill Firefox进程使用 kill -3 kill -2 命令,下一次我打开一个新的Firefox窗口,询问我是否想在安全模式下运行。我知道调用 kill -9 可能会混淆Firefox,所以它会尝试以安全模式运行,但是 -3 应该如果你有任何想法如何轻轻松松地告诉Firefox正常关闭?

解决方案

  wmctrl -cMozilla Firefox





是你想要的吗?

注意:


  1. 这个命令可能需要在同一个DISPLAY&大概是相同的虚拟桌面,您的firefox正在运行。

  2. 只有第一个匹配的窗口将被关闭。您可能需要循环执行此命令。


I'm doing some automation with Firefox and although I can open Firefox window from shell, I'm not able to terminate it properly. If I kill Firefox process with kill -3 or kill -2 command the next time I open a new Firefox window it asks me if I want to run in safe-mode. I understand that calling kill -9 could confuse Firefox so it would try to run in safe-mode but -3 should be fine.

Do you have any idea how to gently tell Firefox to close properly?

解决方案

How about

wmctrl -c "Mozilla Firefox"

?

Is it what you want?

NOTEs:

  1. This command may need to be fired in same DISPLAY & probably same virtual desktop, on which your firefox is running.
  2. Only first matching window will be closed. You may need to loop this command.

这篇关于如何轻轻地杀死Linux / OS X上的Firefox进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆