linux系統中統計指定類型文件大小的總和


 

1、測試數據

[root@centos7 test2]# ll -h total 1.4G -rw-r--r--. 1 root root  41M Apr 15 09:47 a.map -rw-r--r--. 1 root root 204M Apr 15 09:47 a.ped -rw-r--r--. 1 root root  61M Apr 15 09:48 b.map -rw-r--r--. 1 root root 407M Apr 15 09:47 b.ped -rw-r--r--. 1 root root 611M Apr 15 09:47 c.ped -rw-r--r--. 1 root root  21M Apr 15 09:44 result.map

 

2、統計*.map文件的大小

[root@centos7 test2]# ls *.map | xargs du -ch 41M a.map 61M b.map 21M result.map 121M total [root@centos7 test2]# ls *.map | xargs du -ch | tail -n 1 121M total

 

ped

[root@centos7 test2]# ls *.ped | xargs du -h 204M a.ped 407M b.ped 611M c.ped [root@centos7 test2]# ls *.ped | xargs du -ch 204M a.ped 407M b.ped 611M c.ped 1.2G total [root@centos7 test2]# ls *.ped | xargs du -ch | tail -n 1
1.2G    total

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM