How to delete many 0 byte files in linux?

前端 未结 10 1987
孤街浪徒
孤街浪徒 2020-12-07 11:19

I\'ve a directory with many number of 0 byte files in it. I can\'t even see the files when I use the ls command. I\'m using a small script to delete these files but sometime

10条回答
  •  無奈伤痛
    2020-12-07 11:58

    Use find combined with xargs.

    find . -name 'file*' -size 0 -print0 | xargs -0 rm
    

    You avoid to start rm for every file.

提交回复
热议问题