Find and remove all empty files
find /path/to/mountpoint -empty -type f -delete
If your find does not have -delete
option, replace it with -exec rm '{}' ';'
If you want to delete all empty files except for files directly under /
run:
find / -mindepth 2 -empty -type f -delete
If you want to delete all empty files, but skip whole /root
directory run
find / \( -path /root -prune \) -empty -type f -delete
find . -size 0 -print
.
replace -print
with -delete
and .
with the directory you need, but execute carefully, it will really delete all empty files.