garry_m
asked on
Find size of folder without using 'du'
Hi, is it possible to find the size of a folder without using 'du'?
I have 2 folders and they are supposed to contain exactly the same content, however, when I do a 'du' on each, they return different sizes. Is it possible to return the exact size of these folders using something similar to the 'ls -la' command (which only reads the size of flat files).
Thanks
I have 2 folders and they are supposed to contain exactly the same content, however, when I do a 'du' on each, they return different sizes. Is it possible to return the exact size of these folders using something similar to the 'ls -la' command (which only reads the size of flat files).
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I have no idea about how it does it I thought it measured the actual file size and not the block size.
ASKER
I think (but I am no expert) that 'du' stands for 'disk usage', so that a file can be spread across many blocks, even if it only uses a small amount of space in each of those blocks, the disk usage returned will still show the total size of all those blocks put together, not the actual physical number of bytes in that file.
ASKER