Quote:
Originally Posted by
maheshwin
ls -l will give the output of the total directory links , so dont trust it, du is the exact form to get the info, above commands are perfectly true
-rw-rw-rw- 1 pnt pf 87843360 Feb 6 02:21 /pfta02/10.001
Type of file: - (regular)
Access permission: rw-rw-rw- (readable/writable for everyone)
(Directory) links: 1 (usually 1 for a regular file, unless there are hard links)
owner: prt
group: pf
actual size: 87843360
date of last modification: Feb 6 02:21
filenaam: /pfta02/10.001
So the difference in size has nothing to do with the number of directory links, which is 1 in this case.
The "du" command, without options, reports the size in full disk blocks (usually 512 bytes) allocated by the file, where "ls -l" reports the size of the effective data in the file.
For each file at least 1 full disk block is allocated (actually 2 disk blocks), even of it contains just 1 byte of data.
Files always allocate space in full disk blocks.
Since the "du" commands reports in disk blocks, the result will always be a little bit more than the size reported by "ls -l".
The size of the file = 87843360 bytes
To store this amount of bytes at least 87843360/512 = 171569,0625 disk blocks are needed.
Rounded this would be 171570 full disk blocks. At least 1 extra block is needed, which makes it 171571.
The "du" command reports a size of 171572 blocks which is still 1 block more.
This means the file is most likely split up in 2 fragments.
Where the last block in each segment is not fully filled.