Advertisement
elena1234

how to find and remove files

Dec 12th, 2023 (edited)
913
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.49 KB | None | 0 0
  1. find -iname "*open*" -and -name "*[1,3,5,7,9]_open.txt" | wc -w
  2.  
  3. find -empty
  4.  
  5. find -newer yesterday.txt
  6.  
  7. find -mmin 30 # exactly 30 min
  8. find -mmin +30 # greather than 30 min
  9. find -mmin -30 # less than 30 min
  10. find -mtime -5 # less than 5 hours
  11. find -mtime +5 # greather than 5 hours
  12. find -atime -5 # less than 5 hours
  13. find -atime +5 # greather than 5 hours
  14.  
  15. find -empty -exec rm '{}' ';'
  16. find ~ -name "*.txt" ! -empty -type f -exec grep -l "grass" '{}' ';'
  17. find -empty | xargs ls-l
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement