[Linux] Count the total size of special files
If you want to count the total size of special files. For example if you want to calculate the total size of files which name includes "daily". Then you can use this command to get the result.
find . -name "*daily*" | xargs du -ch
This will list all the files which name includes "daily" and count the total size of these files.
The output will like this:
4.0K ./2016_06_28_daily.log
4.0K ./2016_06_29_daily.log
4.0K ./2016_06_30_daily.log
4.0K ./2016_07_01_daily.log
4.0K ./2016_07_02_daily.log
4.0K ./2016_07_03_daily.log
24K total
If you have some better methods, please tell me :)
Author And Source
この問題について([Linux] Count the total size of special files), 我々は、より多くの情報をここで見つけました https://qiita.com/zhupeijun/items/493c25aa78bcb7fb35e3著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .