Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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

Your Answer


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.