如何从命令行关闭/重新启动phpstorm


17

phpstorm没有响应,我想终止该进程。这是安装位置:/opt/phpstorm/PhpStorm-143.1770/bin

我无法使用X按钮将其关闭,因此请帮助我使用命令行关闭/重新启动它。

谢谢。

Answers:


40

使用“ ps”命令可以看到所有活动的“过程”。在命令行中,您可以输入...

ps -ef | grep phpstorm

它将列出所有进程ID

$ ps -ef| grep phpstorm
rinzwind  2819  2812  0 11:28 ?        00:00:00 phpstorm
rinzwind  2849  2820  0 11:29 pts/1    00:00:00 grep --color=phpstorm

您搜索的是带有“ grep”的行。另一个是可执行文件。一个简单的 ...

kill -9 2819

将停止“ phpstorm”。


较短的方法:

pgrep -f phpstorm

将只列出进程ID和...

kill -9 $(pgrep -f phpstorm)

会杀死它。

诸如“ top”和“ htop”之类的程序可用于列出正在运行的进程。


1
很好,我会在:= D中编辑它,我的想法是解释“ ps”的作用;-)
Rinzwind

杀:解析失败的说法: '11197 11250 11289'
Nechemya Kanelsky

抱歉,我不能在实际的phpstorm上测试它:P是从最后一个命令来的。如果存在这些进程,则“ Cuz -9 11197 11250 11289”应该起作用;)
Rinzwind

但是kill -9 'pid1 pid2'不会!nicolas-bonnici的评论:“您需要删除引号以使其起作用:kill -9 $(pgrep -f phpstorm)
Martin Thornton,
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.