Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
possible duplicate of ls command: what does the first line mean? –  Gilles Apr 11 '11 at 20:46
add comment

2 Answers

up vote 5 down vote accepted

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.
share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.