which
命令似乎没有给出正确的结果:
[ray@localhost ~]$ unalias python
bash: unalias: python: not found
[ray@localhost ~]$ unalias which
bash: unalias: which: not found
[ray@localhost ~]$ which python
/usr/local/bin/python
[ray@localhost ~]$ /usr/local/bin/python -V
Python 2.7.6
[ray@localhost ~]$ python -V
Python 2.6.6
[ray@localhost ~]$ ls -l /usr/local/bin/python*
lrwxrwxrwx. 1 root root 11 Jun 10 12:27 /usr/local/bin/python -> python2.7.6
-rwxr-xr-x. 1 root root 8040 Jun 10 12:21 /usr/local/bin/python2.7
-rwxr-xr-x. 1 root root 8040 Jun 10 12:25 /usr/local/bin/python2.7.6
-rwxr-xr-x. 1 root root 1674 Jun 10 12:23 /usr/local/bin/python2.7-config
lrwxrwxrwx. 1 root root 16 Jun 10 12:23 /usr/local/bin/python2-config -> python2.7-config
lrwxrwxrwx. 1 root root 14 Jun 10 12:23 /usr/local/bin/python-config -> python2-config
[ray@localhost ~]$
答案 0 :(得分:3)
不,which
没问题。 bash很困惑。
hash -d python