total size of group of files selected with 'find'

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

    The command du tells you about disk usage. Example usage for your specific case:

    find rapidly_shrinking_drive/ -name "offender1" -mtime -1 -print0 | du --files0-from=- -hc | tail -n1
    

    (Previously I wrote du -hs, but on my machine that appears to disregard find's input and instead summarises the size of the cwd.)

提交回复
热议问题