What is the difference between du -h and ls -lh?

Posted by PeanutsMonkey on Server Fault See other posts from Server Fault or by PeanutsMonkey
Published on 2011-07-13T20:31:27Z Indexed on 2012/09/14 21:40 UTC
Read the original article Hit count: 223

Filed under:
|
|

I am having a difficult time grasping what is the correct way to read the size of the files since each command gives you varying results. I also came across a post at http://forums.devshed.com/linux-help-33/du-and-ls-generating-inconsistent-file-sizes-42169.html which states the following;

du gives you the size of the file as it resides on the file system. ( IE will will always give you a result that is divisible by 1024 ).

ls will give you the actual size of the file.

What you are looking at is the difference between the actual size of the file and the amount of space on disk it takes. ( also called file system efficiency ).

What is the difference between as it resides on the file system and actual size of the fil

© Server Fault or respective owner

Related posts about linux

Related posts about ls