Linux

최근 변경 파일 찾기

_Erato 2014. 12. 12. 15:25

[출처] : http://jmnote.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_n%EC%9D%BC_%EC%9D%B4%EB%82%B4%EC%97%90_%EC%88%98%EC%A0%95%EB%90%9C_%ED%8C%8C%EC%9D%BC_%EC%B0%BE%EA%B8%B0

수정일이 n일 이내인 파일 찾기
n일 내에 수정된 파일 찾기
지난 n일동안 변경된 파일 찾기

find 폴더 -type f -mtime -일수 -print
find 폴더 -type f -mtime -일수 -ls

실행예시

[root@jmnote ~]# find /var/log/httpd/ -type f -mtime -7 -print
/var/log/httpd/error_log-20131229
/var/log/httpd/error_log
[root@jmnote ~]# find /var/log/httpd/ -type f -mtime -7 -ls
271564    8 -rw-r--r--   1 root     root         6321 Dec 29 12:31 /var/log/httpd/error_log-20131229
271565    8 -rw-r--r--   1 root     root         4245 Jan  2 19:53 /var/log/httpd/error_log