When running ls -l, why does the filesize on a directory not match the output of du?

前端 未结 4 1515
不思量自难忘°
不思量自难忘° 2021-01-21 02:43

What does 4096 mean in output of ls -l?

[root@file nutch-0.9]# du -csh resume.new/
2.3G    resume.new/
[root@file nutch-0.9]# ls -l 
total 55132
drw         


        
4条回答
  •  旧时难觅i
    2021-01-21 03:24

    Directories are just like files with tuples, and that are specially treated by the filesystem. The size reported by ls is the size of this "file". Check this answer in Server Fault for an overview of how directories are under the hood.

    So, the 4096 bytes mean, most likely, that the filesystem block size is 4096 and that directory is currently using a single block to store this table of names and inodes.

提交回复
热议问题