I am used to listing and sorting the size of files as follows:
$ for entry in $(ls); do du -s "$entry"; done | sort -n
However, how does one delete all files of 0 bytes?
My terrible attempt would be to try an if conditional, but I don't know how to check the size. I would then pipe all results and remove these?
$ for entry in $(ls); if du -s "$entry" == 0 | rm "$entry"
ls
– Kusalananda May 10 '17 at 17:40