Advertisement
TheAlkaris

Zero Byte Erase!

Jul 11th, 2015
583
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.81 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ##########################################################
  4. ## the purpose of this script is to find those stupidly ##
  5. ## useless annoying Zero Byte files and delete them     ##
  6. ## that are generated by software that doesn't even use ##
  7. ## them, or leaves residual empty files on your system. ##
  8. ##                                                      ##
  9. ## This can cause problems when backing up your files,  ##
  10. ## because the software to back them up doesn't know    ##
  11. ## what to do with these empty zero byte files. You     ##
  12. ## need to run this with 'sudo' if it calls for it.     ##
  13. ##########################################################
  14.  
  15. lns=`vdir -R *.* $dir| awk '{print $8"\t"$5}'`
  16. temp=""
  17. for file in $lns
  18. do
  19.  
  20. if test $file = "0"
  21. then
  22. printf $temp"\t"$file"\n"
  23. fi
  24. temp=$file
  25. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement