LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   ls gives total 8 when dir empty (https://www.linuxquestions.org/questions/fedora-35/ls-gives-total-8-when-dir-empty-672810/)

JavaNinja 09-27-2008 07:30 PM

ls gives total 8 when dir empty
 
Hello all,

Can some help me understand this:

Code:

[root@ip folder]# ls -lart
total 8
drwxr-xr-x 5 root root 4096 Sep 26 09:48 ..
drwxr-xr-x 2 root root 4096 Sep 26 09:48 .

I only see 2 things, what does the "total 8" mean?

Sorry for the nooby question, didn't know how to phrase this in google.

Thanks all

MS3FGX 09-27-2008 09:13 PM

The total isn't the count of the files listed, but the size. While there are no "files" in the traditional sense, the "../" and "./" links have a size to them so they are counted.

JavaNinja 09-28-2008 11:38 AM

Ah, I see. Is the size in KB?

PTrenholme 09-29-2008 10:53 PM

Code:

$ ls -larth empty
total 8.0K
drwx------ 52 Peter Peter 4.0K 2008-09-29 20:50 ..
drwxrwxr-x  2 Peter Peter 4.0K 2008-09-29 20:50 .


JavaNinja 09-30-2008 04:34 AM

Many thanks for that.


All times are GMT -5. The time now is 11:16 PM.