bash 如何在MAC中使用终端查找chrome浏览器版本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44612147/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to find the chrome browser version using terminal in MAC?
提问by Prashanth Sams
回答by Fiid
Your question says "in Linux/Mac". Looking at the issue you have it looks like you might be using a mac, in which case the google-chome
binary will be hidden away in the Applications folder. On my mac, this works:
您的问题是“在 Linux/Mac 中”。查看您遇到的问题,您可能使用的是 mac,在这种情况下,google-chome
二进制文件将隐藏在 Applications 文件夹中。在我的 Mac 上,这有效:
$ /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version
Google Chrome 59.0.3071.104
If you're not using a mac, it could well be because the path to your google-chome
binary isn't in your $PATH
variable, so I'd either specify the complete path, or add the right path to $PATH
.
如果您没有使用 mac,很可能是因为google-chome
二进制文件的路径不在您的$PATH
变量中,所以我要么指定完整路径,要么将正确的路径添加到$PATH
.
回答by Ashraful Islam
I have tried in my terminal. It's working. Please check yours. Please make sure that you have installed google chrome, not chromium.
我在我的终端中尝试过。它正在工作。请检查你的。请确保您已安装谷歌浏览器,而不是铬。
Update for Mac:Your Mac is not allowing google-chrome as an environment variable. So, you can't access from terminal or CLI. You may use simple hack,
Mac 更新:您的 Mac 不允许 google-chrome 作为环境变量。因此,您无法从终端或 CLI 访问。你可以使用简单的hack,
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version
Note:The command will be like that. Use according to your machine.
注意:命令将是这样的。根据您的机器使用。
google-chrome --version