User Tools

Site Tools


ubuntu:find:find_and_delete_files_after_a_certain_time

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ubuntu:find:find_and_delete_files_after_a_certain_time [2019/11/29 12:13] – created peterubuntu:find:find_and_delete_files_after_a_certain_time [2022/06/13 08:36] (current) – removed peter
Line 1: Line 1:
-====== Ubuntu - Find - Find and delete files after a certain time ====== 
  
-<code bash> 
-find /path/to/folder -type f -name "<regex-for-file-name>" -mtime +<number-of-days> -exec <bash-command> {} \; 
-</code> 
- 
-Example usage: 
- 
-<code bash> 
-find /var/spool/somedir/someotherdir -type f -name "msg*" -mtime +30 -exec rm {} \; 
-</code> 
ubuntu/find/find_and_delete_files_after_a_certain_time.1575029613.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki