对于命令"ls *"的输出我感到困惑。我在Ubuntu 11.10和Redhat Enterprise 6.3上测试了以下场景,并得到了相同的结果。
Shell日志
$ uname -a
Linux 2.6.32-279.19.1.el6.x86_64 #1 SMP Sat Nov 24 14:35:28 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
$ echo $0
-bash
$ cd test
$ ls
$ ls * *<== at first, no file/directory under current work directory*
ls: cannot access *: No such file or directory
$ mkdir abc *<== create a new directory "abc"*
$ ls * *<== output of "ls *" is empty but directory "abc" has been created.*
$ mkdir abcd *<== create the second directory "abcd"*
$ ls * *<== at this point, all the directories("abc" and "abcd") are displayed.*
abc:
abcd:
有人能解释一下为什么在创建了目录 "abc" 后,"ls *" 的输出为空吗?谢谢。