Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
shell:find [2020/04/08 16:50] – [find] tmadeshell:find [2020/05/29 00:26] – [find] tmade
Line 13: Line 13:
   find /tmp -mtime +5 -exec rm {} \;                                         #Removes files in "/tmp" older 5 days   find /tmp -mtime +5 -exec rm {} \;                                         #Removes files in "/tmp" older 5 days
   find /tmp/* -mtime +5 -exec rm -rf {} \;                                   #Delete all files or folders older than 5 days   find /tmp/* -mtime +5 -exec rm -rf {} \;                                   #Delete all files or folders older than 5 days
 +  find /path/to/files/ -type f -name "*.tar" -mtime +20 -exec rm {} \;       #Delete all files in path older than 20 days with extension *.tar
   find /sourcedirectory -mtime +365 -exec ls -al "{}" /dest/directory/ \;    #List results for testing   find /sourcedirectory -mtime +365 -exec ls -al "{}" /dest/directory/ \;    #List results for testing
   find /sourcedirectory -mtime +30 -exec mv "{}" /destination/directory/ \;  #Moves files older 30 days from sourcedirectory to destination   find /sourcedirectory -mtime +30 -exec mv "{}" /destination/directory/ \;  #Moves files older 30 days from sourcedirectory to destination
shell/find.txt · Last modified: 2024/03/21 14:09 by tmade
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki