how-to delete 0 bytes files

ls -lahS | awk ‘{if( $5==0 ) print $8}’ | xargs rm

Comments (2) to “how-to delete 0 bytes files”

  1. Hey, what about:

    find . -size 0 | xargs rm

    Cheers!

  2. If you want to do the same with find you should add a maxdepth, something like this,

    find ./* -maxdepth 0 -size 0 | xargs rm

    or

    find ./* -maxdepth 0 -size 0 -exec rm {} +

Post a Comment
*Required
*Required (Never published)