bash - 无法从终端在浏览器中打开 html 文件
问题描述
我转到终端上包含文件的目录并输入此命令
google-chrome index.html
并收到此错误
-bash: google-chrome: command not found
解决方案
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。
检查你的输出并适应。
推荐阅读
- python - 类型错误:is_valid() 缺少 1 个必需的位置参数:'self'
- mongodb - MongoDB - 如何过滤包含键的文档
- wordpress - 在使用木材的第一页之后每页使用不同的帖子?
- graphql - 如何指定采用多种类型的 graphql 类型?
- c# - 编写实用程序类时异常处理的最佳实践 c#
- python - Keras Convolution1D 输入形状
- android - 如何从activivty调用服务中的进度对话框
- javascript - 当用户开始输入时如何显示输入的最大长度?
- java - 在这里,Main 类抛出 DERIVED 而不将 Main 声明为 THROWS 但它有效,谁能解释一下
- python-3.x - Downloading files using Python requests