Advertisement
tuipveus

find xargs delete mv

Dec 21st, 2012
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. root@tuipveus:/tmp# time find . -maxdepth 1 -type f -name \*NO-IP* -exec ls '{}' \; |wc -l
  2. 22422
  3.  
  4. real    4m16.999s
  5. user    1m37.822s
  6. sys 2m34.178s
  7.  
  8. find . -type f -name '*.txt' -print0 |xargs -0 -l50 rm
  9. find . -maxdepth 1 -type f -name '*.txt' -print0 |xargs -0 -l50 ls
  10.  
  11. ################################
  12. FROMDIR=/var/mp/$PRJNUM/log
  13. TODIR=/var/mp/$PRJNUM/log/old
  14. find "$FROMDIR" -maxdepth 1 -type f -name "*$NOW" -mtime -1 -print0 | xargs -0 -r -I {} mv {} "$TODIR"
  15. http://www.gnu.org/software/findutils/manual/html_node/find_html/Deleting-Files.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement