How do I delete files older than 7 days UNIX?

Trương Duy

New member
How do I delete files older than 7 days UNIX?
Answer
Explanation:
  1. find : the unix command for finding files/directories/links and etc.
  2. /path/to/ : the directory to start your search in.
  3. -type f : only find files.
  4. -name ‘*. …
  5. -mtime +7 : only consider the ones with modification time older than 7 days.
  6. -execdir …
 

Tìm kiếm

Back
Top