![“在 PATH 中找不到 foo” - 但它就在那里](https://linux22.com/image/208218/%E2%80%9C%E5%9C%A8%20PATH%20%E4%B8%AD%E6%89%BE%E4%B8%8D%E5%88%B0%20foo%E2%80%9D%20-%20%E4%BD%86%E5%AE%83%E5%B0%B1%E5%9C%A8%E9%82%A3%E9%87%8C.png)
我看到以下行为:
$ foo
Could not find foo in PATH
$ which foo
/usr/local/corp/bin/foo
$ readlink -f `which foo`
/path/to/opt/foo/foo
$ /usr/local/corp/bin/foo
starting foo, output for foo, blah blah blah
这是一台 Centos 7 机器,Linux 内核为 3.10.0-1160.53.1.el7.x86_64 。外壳是bash。
笔记:
- 是的,
/usr/local/corp/bin
在我的$PATH
. /usr/local/corp/bin/foo
是到 的符号链接/path/to/actual/binary/foo
。hash -r
没有帮助。