我在某个目录中有这样的文件:
my@unix:~/kys$ ls
address_modified_20130312.txt customer_rows_full_20131202.txt
customer_full_20131201.txt customer_rows_modified_20131202.txt
customer_modified_20131201.txt
my@unix:~/kys$
我想使用 grep 来获取某些以“客户”开头的文件名。我试过这个
my@unix:~/kys$ ls | grep customer.*
customer_full_20131201.txt
customer_modified_20131201.txt
customer_rows_full_20131202.txt
customer_rows_modified_20131202.txt
my@unix:~/kys$
但这给了我这些我不想要的 customer_rows.* 文件。正确的结果集是
customer_full_20131201.txt
customer_modified_20131201.txt
如何做到这一点?