我有這樣的文件在某個目錄:如何使用grep獲取某些文件名?
[email protected]:~/kys$ ls
address_modified_20130312.txt customer_rows_full_20131202.txt
customer_full_20131201.txt customer_rows_modified_20131202.txt
customer_modified_20131201.txt
[email protected]:~/kys$
我想用grep獲取與一個字「客戶」開頭的文件名一定。我試過這個
[email protected]:~/kys$ ls | grep customer.*
customer_full_20131201.txt
customer_modified_20131201.txt
customer_rows_full_20131202.txt
customer_rows_modified_20131202.txt
[email protected]:~/kys$
但是,這給了我這些customer_rows。*文件,我不想。正確的結果集是
customer_full_20131201.txt
customer_modified_20131201.txt
如何實現此目的?