如果“which X”找到了某些东西但是执行“X”失败了,这意味着什么?

如果“which X”找到了某些东西但是执行“X”失败了,这意味着什么?

具体来说,python:

$ which python
/usr/bin/python

$ ll `which python`
lrwxrwxrwx 1 root root 9 Jun 18 10:26 /usr/bin/python -> python2.7

$ python
The program 'python3' is currently not installed.

$ ll /usr/local/bin/python
ls: cannot access /usr/local/bin/python: No such file or directory

$ whereis python
python: /usr/bin/python /usr/bin/python2.7 /etc/python /etc/python2.7 /usr/lib/python2.7 /usr/bin/X11/python /usr/bin/X11/python2.7 /usr/local/lib/python2.7 /usr/include/python2.7 /usr/share/python /usr/share/man/man1/python.1.gz

$ python2.7 
Python 2.7.3 (default, Sep 26 2013, 20:03:06) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

我不明白为什么python这里不能运行 python2.7——符号链接不是指向 python2.7 吗?

答案1

你可能有一个别名。尝试type -a python

相关内容