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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 16:13:14  来源:igfitidea点击:

How to find the chrome browser version using terminal in MAC?

bashmacosgoogle-chrometerminal

提问by Prashanth Sams

Tried the below; but nothing seems to work

尝试了以下方法;但似乎没有任何效果

google-chrome --version

google-chrome-stable --version

chrome --version

enter image description here

在此处输入图片说明

Build: Version 58.0.3029.110 (64-bit)enter image description here

内部版本:版本 58.0.3029.110(64 位)在此处输入图片说明

回答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-chomebinary 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-chomebinary isn't in your $PATHvariable, 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

enter image description here

在此处输入图片说明