LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Using ls (https://www.linuxquestions.org/questions/linux-newbie-8/using-ls-341300/)

Echo Kilo 07-08-2005 11:56 AM

Using ls
 
When using ls -l, what is the total that is given at the top? It doesn't appear to correspond with the number of files I see.

What option can you use to display the number of files in a directory?

Linux.tar.gz 07-08-2005 11:59 AM

Take a look at man ls.

Echo Kilo 07-09-2005 03:38 PM

Okay, I read that but still don't know what the total below means. Man page also doess not state which option will report total files.

ls -l

total 96
drwx------ 4 ekridaka students 4096 Jul 6 01:56 .
drwxr-xr-x 24 root root 4096 Jun 30 17:14 ..

Tinkster 07-09-2005 04:22 PM

That value is actually explained in
info coreutils ls

But the OP could have found that themselves if they
had been curious enough and read the entire man-
page themselves, and followed the advice in the
SEE ALSO section of man.

In brief, the total gives the total number of BLOCKS
used by the directory.


Cheers,
Tink

eddiebaby1023 07-09-2005 06:04 PM

A neat trick that ls does is columnarise output if it's going to a terminal, otherwise it prints one filename per line. The -1 flag replicates this behaviour to a terminal. To replicate the terminal behaviour to a non-terminal device, use -C.


All times are GMT -5. The time now is 09:29 AM.