1836491 Members
1931 Online
110101 Solutions
New Discussion

Re: output from ls

 
SOLVED
Go to solution
Karl Myers_1
Occasional Advisor

output from ls

what does the total refer to when using ls returns

total 8
file
file
4 REPLIES 4
John Palmer
Honored Contributor
Solution

Re: output from ls

Hi,

From 'man ls'

When an option is specified that results in a listing of directory and/or file sizes in bytes or blocks (such as the -s or -l (ell) option), a total count of blocks, including indirect blocks, is also printed at the beginning of the listing.

So it's the number of blocks occupied by the files/directories that were listed.

Regards,
John
James R. Ferguson
Acclaimed Contributor

Re: output from ls

Hi:

The total number is the total number of blocks (512-bytes each) in the directory. Once allocated they are never deallocated, so if the total value is very large and the number of files in the directory very small, you know at one time that the directory was highly populated.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: output from ls

Hi (again):

Oops, John is correct. The non-shrinking number I was referring to was the size in bytes of the *directory*, not the "total" as I erroneously indicated. The total value is a block count as already noted.

Regards!

...JRF...
Karl Myers_1
Occasional Advisor

Re: output from ls

Thank you both for that.

Your time is appreciated.

Regards
KM