【发布时间】:2013-07-22 10:57:33
【问题描述】:
我有4个文件:命名约定如下:
hello.account.sub1.001
hello.account.sub2.001
hello.account.sub3.001
hello.account.sub4.001
如果我使用ls -l hello.account*001搜索文件,没有问题。
但是,使用ls -l hello.account.*.001时存在问题
系统抱怨No such file or directory
我假设系统认为 hello.account.*.001 是单个文件。
这让我很感兴趣,所以我问:如果将句号指定为搜索条件,您如何搜索文件?
非常感谢
【问题讨论】:
-
The system complains that No such file or directory- 不,这对我有用。您使用的是哪个外壳? -
应该仍然有效 - 文件名通配是由 shell 完成的,除非模式被转义,所以你仍然应该看到所有四个文件。如果你这样做会有所不同
ls -l "hello.account.*.001" -
因为我在学校的unix系统中遇到了这个问题,所以目前无法测试。我想我可以在文件名中添加引号。
-
无论如何,谢谢您的热情回复!