total size of group of files selected with 'find'

后端 未结 7 1911
庸人自扰
庸人自扰 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:30

    I'd like to promote jason's comment above to the status of answer, because I believe it's the most mnemonic (though not the most generic, if you really gotta have the file list specified by find):

    $ du -hs *.nc
    6.1M  foo.nc
    280K  foo_region_N2O.nc
    8.0K  foo_region_PS.nc
    844K  foo_region_xyz.nc
    844K  foo_region_z.nc
    37M   ETOPO1_Ice_g_gmt4.grd_region_zS.nc
    $ du -ch *.nc | tail -n 1
    45M total
    $ du -cb *.nc | tail -n 1
    47033368  total
    
    0 讨论(0)
提交回复
热议问题