removing corrupted files using a bash script [closed]

℡╲_俬逩灬. 提交于 2019-12-13 10:01:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!