removing corrupted files using a bash script [clos

2019-09-22 06:46发布

问题:

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?



标签: bash find grep