Find all zero-byte files in directory and subdirectories

后端 未结 4 608
南笙
南笙 2021-01-30 03:05

How can I find all zero-byte files in a directory and its subdirectories?

I have done this:

#!/bin/bash
lns=`vdir -R *.* $dir| awk \'{print $8\"\\t\"$5}\         


        
4条回答
  •  [愿得一人]
    2021-01-30 03:35

    As addition to the answers above:

    If you would like to delete those files

    find $dir -size 0 -type f -delete
    

提交回复
热议问题