How to find zero-bytes files in directory and remove them

find -maxdepth 1 -size 0 -print | xargs rm

The last statement, xargs rm is optional. If this defined, then the it will remove those zero-bytes files immediately in a one-liner.

Leave a Reply

Your email address will not be published. Required fields are marked *