To monitor the file status of the node (number of time holders)
Start monitoring the number of files with find./-type F |wc-l
Monitor file size Du-sk
Problems that arise:
1, the same files in different versions (centos6.5 and centos5.8) the size of the system is inconsistent
centos6.5 File System Ext4
centos5.8 File System ext3
PS: The difference between Du and LL
Du: File occupies space
LL: The actual size of the file
2, find will put unnecessary hidden files will also find out, the data is not accurate
Find= folder + files + hidden files
Scheme:
Statistics File size instead
Ls-lr/kaolawu/data |grep "^-" |awk-f\ ' begin{sum=0}{sum+=\$5}end{printf \ "%-15d\n\", Sum} '
Number of statistical files instead
Ls-lr/kaolawu/data |grep "^-" |wc-l
This is accurate.
This article is from the "Czwanga" blog, make sure to keep this source http://czwanga.blog.51cto.com/4840967/1922547
Linux file size and quantity statistics