total size of group of files selected with 'find'

后端 未结 7 1917
庸人自扰
庸人自扰 2020-12-07 16:32

For instance, I have a large filesystem that is filling up faster than I expected. So I look for what\'s being added:

find /rapidly_shrinking_drive/ -type f          


        
7条回答
  •  暖寄归人
    2020-12-07 17:23

    You could also use ls -l to find their size, then awk to extract the size:

    find /rapidly_shrinking_drive/ -name "offender1" -mtime -1 | ls -l | awk '{print $5}' | sum
    

提交回复
热议问题