How do I delete 7 day old logs in Linux?

How do I delete 7 day old logs in Linux?
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