问题
I have many "bad" files after recover my broken hdd.
I need script in bash which helps me remove bad files like
- zero byte consists only (00 00 00 00 00 ...)
回答1:
It's better to use find:
find -maxdepth 1 -type f -empty -print0 | xargs -0 rm -f -v
回答2:
find . -type f -size 0c -maxdepth 1 -exec rm {} \;
How about this?
来源:https://stackoverflow.com/questions/9044481/removing-corrupted-files-using-a-bash-script