终端Mac Os:如何知道执行的命令?

时间:2014-08-28 17:16:19

标签: linux macos terminal

我正在尝试安装PyQT,安装读取说我应该执行以下操作:

  
    

python configure.py         查询qmake关于你的Qt安装......         错误:PyQt5需要Qt v5.0或更高版本。你好像在使用v4.8.6。使用         --qmake标志指定正确的地震版本。

  
>> qmake -v
QMake version 2.01a
Using Qt version 4.8.6 in /usr/local/Cellar/qt/4.8.6/lib

所以我看到qmake不是正确的版本。但我问另一个问题:我怎么知道执行者是什么?“qmake”???更全面:当我们键入终端cmd时如何知道运行哪个可执行文件?

由于 罗曼。

3 个答案:

答案 0 :(得分:1)

使用type。在简单的情况下,这看起来很像which

$ type make
make is /usr/bin/make
$ which make
/usr/bin/make

但是,请考虑:

$ type [
[ is a shell builtin
$ which [
/bin/[

在这种情况下,type正确告诉您[ -f . ]使用内置于您的shell中的[实现,而which错误地告诉您可执行文件使用/bin/[

别名,shell函数等也是如此:which仅告诉您可执行文件,但type告诉您正在运行的是否是可执行文件。

答案 1 :(得分:1)

PyOt没有安装,因为你的Qt已经过时了。 试试

brew install qt

如果您安装了自制程序包管理器。它不会再次下载,只是更新它。

如果您有MacPorts,请尝试

sudo port install qt5-mac

。它会更新您的Qt和QMake版本。

了解shell命令所在的文件夹...使用

which commandname  

whereis commandname

答案 2 :(得分:0)

使用 命令

您需要哪个命令。哪个(1)手册页部分地说:

DESCRIPTION
       which returns the pathnames of the files (or links) which would be exe‐
       cuted in the current environment, had its arguments been given as  com‐
       mands  in a strictly POSIX-conformant shell.  It does this by searching
       the PATH for executable files matching the names of the  arguments.  It
       does not follow symbolic links.

实施例

例如,在我的系统上,该命令返回以下内容:

$ which qmake
/usr/bin/qmake

您也可以使用which -a qmake查找所有 PATH 中找到的版本,而不仅仅是首次匹配。希望这有帮助!