close

이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.

linux

find newer로 특정날짜 검색

mysop 2021. 5. 26. 13:30
728x90
반응형

날짜를 직접 지정해서 find로 검색이 가능하다

 

# touch -t 시작날짜입력 파일명

# touch -t 202101010000 start.txt

 

# touch -t 끝날짜입력 파일명

# touch -t 202101010000 end.txt

 

# find 폴더명 -newer start.txt -a ! -newer end.txt

 

해당 결과 삭제요청시

 

# find 폴더명 -newer start.txt -a ! -newer end.txt -exec rm -f {} \;

 

끝~

 

 

728x90
반응형

'linux' 카테고리의 다른 글

centos 호스트명 변경  (0) 2021.06.08
리눅스 파일삭제 inode 사용  (0) 2021.05.26
cp: overwrite 물음 없애기  (0) 2021.05.26
yum실행시 Error: rpmdb open failed  (0) 2021.05.25
리눅스 ls 날짜별 정렬  (0) 2021.05.24