Advertisement
sunu

find cp mv copy move

Sep 6th, 2013
169
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. find . -maxdepth 1 -type f -name \*.iso -exec du -BMiB {} \; | sort -n
  2. find . -maxdepth 1 -type f -name \*.iso -exec du -hs {} \; | sort -n
  3. du . -h --max-depth=1 | sort -n
  4. du -a . | sort -n -r | head -n 10
  5. du -hsx * | sort -rh | head -10
  6. du --max-depth=1 /home/ | sort -n -r
  7.  
  8. Copy found file using find and cp, GNU/Linux CLI
  9.  
  10. $ find . -maxdepth 15 -type f -iname \*attiny\*pwm\* -exec cp {} ../VIDEOS\ all_electronics\ NEWSORTED/ardu\ singles/ \;
  11.  
  12. $ find . -maxdepth 15 -type f -iname \*attiny\*pwm\* -exec cp {} /home/bejo/dir01/ \;
  13. $ find . -maxdepth 15 -type f -iname \*attiny\*pwm\* -exec mv {} /home/bejo/dir01/ \;
  14.  
  15. find . \( -name file1 -o -name file2 -o ... \) >outputfile
  16. find . \( -name "*.c" -o -name "*.h" -o -name "*.sc" -o -name "*.ini" \) -print
  17. find . \( -name \*foo\* -o -name \*bar\* \)
  18.  
  19. find ./DATA\ SUNU\ 003/zzPython/ -maxdepth 12 -type f -size +2M \( -iname *.flv -o -iname \*.mp4 -o -iname \*.wmv \)
  20. find . -maxdepth 9 \( -iname \*.mp4 -o -iname \*.flv -o -iname \*.wmv -iname \*.ogv \)
  21.  
  22. find . -wholename './src/emacs' -prune -o -print
  23. find . -maxdepth 9 -path ./zzPython -prune -o -iname \*python\* -size +1M | less
  24. find . -maxdepth 9 -path ./zzPython -prune -o -iname \*python\* -size +1M -exec basename {} \;
  25. find . -maxdepth 9 -path ./zzPython -prune -o -iname \*python\* -size +1M -exec du -h {} \;
  26.  
  27. find ./dir1 -type f -exec basename {} \;
  28.  
  29. find . -maxdepth 8 \( -iname \*python\* -and -iname *.mp4 -and -iname \*class\* \)
  30. find . -maxdepth 9 -iname zzPython -prune -o -iname \*python\*
  31. find . -maxdepth 9 -iname zzPython -prune -o -iname \*python\* -size +1M
  32.  
  33. find . -iname '*.pdf' -exec pdftotext {} - \; | grep "john bird"
  34.  
  35. find . -maxdepth 9 \( -iname '*.pdf' -o -iname '*.chm' -o -iname '*.djvu' \) -iname \*a\* -iname '*comm*' -size +500k -ctime -10 | less
  36.  
  37. df -h | sort -h -k 2,2
  38. df -h | sort -n -k 2,2
  39. df -h | sort -h -k 5,5
  40. df -h | sort -n -k 5,5
  41.  
  42. df -h | egrep ^/ | sort -h -k 5,5
  43.  
  44. find . -maxdepth 6 -size +200k \( -iname '*.pdf' -o -iname '*.chm' -o -iname '*.djvu' \) -iname \*electromagnetic*compa\* | xargs -I {} cp {} ~/temp_in_home/
  45.  
  46. find . -name "*.txt" | xargs -I '{}' mv '{}' /foo/'{}'.bar
  47.  
  48. find . -maxdepth 6 -size +200k \( -iname '*.pdf' -o -iname '*.chm' -o -iname '*.djvu' \) -iname \*electromagnetic*compa\* -print0 | xargs -0 -I {} cp {} ~/temp_in_home/
  49.  
  50. find . -maxdepth 9 -size +200k \( -iname '*.pdf' -o -iname '*.chm' -o -iname '*.djvu' \) -iname \*safety\* | xargs -I{} basename {} | sort | xargs -I{} find -iname {}
Advertisement
RAW Paste Data Copied
Advertisement