Difference between revisions of "Mtime"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
  [[find]] /path/to/ -type f -mtime +7 -name '*.gz' -execdir [[rm]] -- '{}' \;
 
  [[find]] /path/to/ -type f -mtime +7 -name '*.gz' -execdir [[rm]] -- '{}' \;
  
 
+
[[find]] /path/to/directory/ -mindepth 1 -mtime +5 -print
 
+
[[find]] /path/to/directory/ -mindepth 1 -mtime +5 -delete <ref>https://unix.stackexchange.com/questions/194863/delete-files-older-than-x-days</ref>
  
 
== Related terms ==
 
== Related terms ==

Latest revision as of 13:55, 8 September 2020

https://askubuntu.com/questions/589210/removing-files-older-than-7-days

find /path/to/ -type f -mtime +7 -name '*.gz' -execdir rm -- '{}' \;
find /path/to/directory/ -mindepth 1 -mtime +5 -print
find /path/to/directory/ -mindepth 1 -mtime +5 -delete [1]

Related terms[edit]

  • -exec

See also[edit]

  • https://unix.stackexchange.com/questions/194863/delete-files-older-than-x-days
  • Advertising: