"ls*"的输出不一致

 拍友2502914513 发布于 2023-02-11 18:07

只是混淆了命令"ls*"的输出.我在Ubuntu 11.10和Redhat Enterprise 6.3中测试了下面的场景,得到了相同的结果.

壳牌日志

$ 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*"为空?谢谢.

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有