What is that "total" in the very first line after ls -l?

Sanket Sahu picture Sanket Sahu · Sep 13, 2011 · Viewed 69.1k times · Source

What is the total in the output of ls -l?

    $ ls -l /etc
    total 3344
    -rw-r--r--   1 root root   15276 Oct  5  2004 a2ps.cfg
    -rw-r--r--   1 root root    2562 Oct  5  2004 a2ps-site.cfg
    drwxr-xr-x   4 root root    4096 Feb  2  2007 acpi
    -rw-r--r--   1 root root      48 Feb  8  2008 adjtime
    drwxr-xr-x   4 root root    4096 Feb  2  2007 alchemist

Answer

Mat picture Mat · Sep 13, 2011

You can find the definition of that line in the ls documentation for your platform. For coreutils ls (the one found on a lot of Linux systems), the information can be found via info coreutils ls:

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.