+ -
当前位置:首页 → 问答吧 → ls在/bin目录下变现出的怪异行为

ls在/bin目录下变现出的怪异行为

时间:2011-06-21

来源:互联网

本帖最后由 liion631818 于 2011-06-21 15:16 编辑
  1. pwd
  2. /bin
  3. ls -l test
  4. -rwxr-xr-x 1 xxxxx root 53774 2010-04-29 11:34 test #不理解的地方,为什么能打印出这句???

  5. ls -l test.exe
  6. -rwxr-xr-x 1 xxxxx root 53774 2010-04-29 11:34 test.exe
  7. find . -name test

  8. find . -name test.exe
  9. ./test.exe
复制代码
通过上面的find可以证明/bin目录下并不存在test文件,但是存在test.exe文件,但是ls -l test却能列出test的信息呢?
环境是cygwin的,请高手解释下。

是不是因为test是bash的内建命令?但是切换到其他目录,比如/home下,ls -l test 却报错了

作者: liion631818   发布时间: 2011-06-21

Win默认PATH路径下的可执行文件带.exe
非PATH路径下的不默认带

作者: ryh19860922   发布时间: 2011-06-21

回复 ryh19860922


    忘了这层了,看来只有cygwin下才有这种现象了。

作者: liion631818   发布时间: 2011-06-21