这是巴什。鱼的行为相似。
$ which python
/usr/bin/python
$ alias py=python
$ type py
py is aliased to `python'
然后,运行type -P py
什么也不打印,正如我所期望的那样以/usr/bin/pyton
类似于下面看到的方式打印。
$ type ls
ls is aliased to `ls --color=auto'
$ type -P ls
/bin/ls
该-P
选项的文档为
-P force a PATH search for each NAME, even if it is an alias,
builtin, or function, and returns the name of the disk file
that would be executed
我已经确认/usr/bin
(所在目录python
)在PATH
.
这里发生了什么?