How to delete many 0 byte files in linux?

前端 未结 10 1996
孤街浪徒
孤街浪徒 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:39

    You can use the following command:

    find . -maxdepth 1 -size 0c -exec rm {} \;

    And if are looking to delete the 0 byte files in subdirectories as well, omit -maxdepth 1 in previous command and execute.

提交回复
热议问题