首页 > 解决方案 > 无法从终端在浏览器中打开 html 文件

问题描述

我转到终端上包含文件的目录并输入此命令 google-chrome index.html 并收到此错误 -bash: google-chrome: command not found

标签: bashgoogle-chrometerminal

解决方案


google-chrome not found 应该是不言自明的。

在终端上运行:

which google-chrome

将输出用作命令。

在我的 Ubuntu 中,google-chrome 被放置在这里:

/usr/bin/google-chrome

所以,就我而言,我会运行:

/usr/bin/google-chrome index.html

如果 'which google-chrome' 命令的输出为空,则应先安装 google-chrome。

考虑到您的评论,也许该过程有另一个名称。在运行 chrome 的情况下,在终端中执行:

ps  -ef | grep chrome

在我的输出中,它就像:

用户名 32276 22430 0 14:03 ? 00:00:12 /opt/google/chrome/chrome

所以,如果我运行:

/opt/google/chrome/chrome index.html 

Chrome 将启动并打开 index.html。

检查你的输出并适应。


推荐阅读