📚 [Linux] 오래된 파일 삭제하기

Category: Linux | 📅 June 22, 2020

오래된 파일의 삭제는 find 명령으로 삭제하자.

왜? 찾아야 지우지!

기간으로 구분하여 삭제하기

[1일 지난 파일]

$find [djirectory] -mtime +0 -exec rm -f {} \;

+0 1일..인데.. 7일은 +7을 써줘야 함. 왜 그럴까…;;; 시간의 기준은 현재시간임.

[만들어진지 30일 이상된 파일]

$find [directory] -type f -mtime +30 -exec rm -f {} \;
🏷️ Tags
  • #tips  
  • #Linux  
  • #Delete-Old-File  
  • #find