2012-02-27 94 views
0

我的test.txt看起來像這樣提取文件名[殼牌]

drwx------+ 5 dc staff 170 Jan 19 00:17 stopwords.txt 
drwxr-xr-x 4 dc staff 136 Feb 20 21:15 test.pl 
-rw-r--r-- 1 dc staff 845 Feb 26 00:09 test.txt 
-rw-r--r-- 1 dc staff 917 Feb 26 00:45 test1.txt 

我想提取其當前日期之前創建1周這些文件(運行shell腳本時)

回答

3

,而不是分析與目錄內容的文本文件,你可以直接使用find

find <directory> -ctime +7 

這將打印<directory>下的所有文件已創建超過7天前。請致電related question

+0

感謝您的鏈接和您的答案! – Debaditya 2012-02-27 15:57:40