0

I have files in a unix directory as shown below

XMP.df.a.xml
XPL.dg.a.xml
XMP.sf.b.xml
XPL.ba.b.xml
XMP.ad.c.xml
XPL.lk.b.xml

I have to list out the files that have both "XMP" and "b" in its name.

I tried ls -ltr XMP* *b* But it displays all the 'XMP' as well as 'b' results.

Is there a way to list only the files that has XMP and b in it's name? Thanks in advance.

4

1 回答 1

3

这个空间让你头疼。您现在拥有的是要求 ls 查找两组不同的文件;XMP* *b*在当前目录中。你想要的是:

ls -ltr XMP*b*

没有空间。

于 2015-07-17T11:22:04.737 回答