5

When I run ls -l, the following is displayed:

>: ls -l
total 320
-rw-r--r--   1 foo  staff    633  5 Apr 13:23 A.class
-rw-r--r--   1 foo  staff    296  5 Apr 13:24 A.java
...

What does the total signify? Size? If so, what size?

1

2 Answers 2

6

It's the total number of blocks (usually 512 bytes per POSIX; see man ls for details of the $BLOCKSIZE environment variable) as obtained from the st_blocks and st_blocksize elements of the stat() structure for each file. As such, it is not recursive and not bloated by "sparse" files.

5

From man 1 ls on Mac OS X 10.6.7, specifically the section titled "The Long Format"

In addition, for each directory whose contents are
displayed, the total number of 512-byte blocks used by the files in the directory is
displayed on a line by itself, immediately before the information for the files in
the directory.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .