This has got to be an easy one, but I can't find the answer anywhere. What exactly is the "total" that is reported when you do an "ls"? I always thought it was the size in MB of the files listed, but it doesn't seem to add up.

Example, when I do a listing in one particular directory (ls -al) I get:

Notice that everything adds up to 44,417,583;
but 43456 * 1024 = 44,498,944

iainr

10-16-2003 09:08 AM

I believe it is a total of the displayed blocks, including indirect blocks. Block size may vary but in your case you presumably have 1k blocks.

Balajisekar

03-14-2012 02:54 PM

Yes, It is the total block size... U can check them with "ls -s" option.

Thanks,
Balaji G

David the H.

03-15-2012 01:46 PM

The info pages for commands like this often go into a lot more detail than the man pages. Check out info ls for a detailed description of all its options.

Code:

`-l'
`--format=long'
`--format=verbose'
In addition to the name of each file, print the file type, file
mode bits, number of hard links, owner name, group name, size, and
timestamp (*note Formatting file timestamps::), normally the
modification time. Print question marks for information that
cannot be determined.

Normally the size is printed as a byte count without punctuation,
but this can be overridden (*note Block size::). For example, `-h'
prints an abbreviated, human-readable count, and
`--block-size="'1"' prints a byte count with the thousands
separator of the current locale.

For each directory that is listed, preface the files with a line
`total BLOCKS', where BLOCKS is the total disk allocation for all
files in that directory. The block size currently defaults to 1024
bytes, but this can be overridden (*note Block size::). The
BLOCKS computed counts each hard link separately; this is arguably
a deficiency.