Results 1 to 5 of 5

Thread: ls -al says total 8 on an empty directory

  1. #1
    eric NNTP User

    Default ls -al says total 8 on an empty directory

    I must be getting senile. When I create a directory from the terminal,
    cd into the new directory and type ls -al, the result comes back with
    total 8 and then lists the current directory and the parent directory.
    Where does the 8 come from?

    Example:

    eric@linux:~> mkdir "New Folder"
    eric@linux:~> cd "New Folder"
    eric@linux:~/New Folder> ls -al
    total 8
    drwxr-xr-x 2 eric eric 4096 2010-06-27 16:32 .
    drwxr--r-- 66 eric eric 4096 2010-06-27 16:32 ..

    eric@linux:~/New Folder> ls -l
    total 0
    That works as I would expect.

    I think ls -al should have shown total 2 but that is what I get for
    thinking. :-)


    I have searched using Google and the man pages but no luck so far.
    I am using openSUSE 11.2 with KDE and using the Konsole terminal.

    Thank you for any help.

    Eric





  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,890
    Blog Entries
    15

    Default Re: ls -al says total 8 on an empty directory

    Quote Originally Posted by eric
    I must be getting senile. When I create a directory from
    the terminal, cd into the new directory and type ls -al, the result
    comes back with total 8 and then lists the current directory and the
    parent directory. Where does the 8 come from?

    Example:

    eric@linux:~> mkdir "New Folder"
    eric@linux:~> cd "New Folder"
    eric@linux:~/New Folder> ls -al
    total 8
    drwxr-xr-x 2 eric eric 4096 2010-06-27 16:32 .
    drwxr--r-- 66 eric eric 4096 2010-06-27 16:32 ..

    eric@linux:~/New Folder> ls -l
    total 0
    That works as I would expect.

    I think ls -al should have shown total 2 but that is what I get for
    thinking. :-)


    I have searched using Google and the man pages but no luck so far.
    I am using openSUSE 11.2 with KDE and using the Konsole terminal.

    Thank you for any help.

    Eric
    Hi
    Add a h and you will see
    Code:
    ls -lah
    --
    Cheers Malcolm (Linux Counter #276890)
    SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.32.12-0.7-default
    up 2 days 7:53, 2 users, load average: 0.02, 0.04, 0.00
    GPU GeForce 8600 GTS Silent - Driver Version: 256.35


  3. #3
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: ls -al says total 8 on an empty directory

    The 8 is saying 8K (as in - total 8.0K), not 8 files. Try using "ls -alh" where h is saying show the size in "human readable format". I assume the 8 K is the minimum the new folder directory is using.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  4. #4
    eric NNTP User

    Default Re: ls -al says total 8 on an empty directory

    On 06/27/2010 05:36 PM, jdmcdaniel3 wrote:
    >
    > The 8 is saying 8K (as in - total 8.0K), not 8 files. Try using "ls
    > -alh" where h is saying show the size in "human readable format". I
    > assume the 8 K is the minimum the new folder directory is using.
    >
    > Thank You,
    >
    >


    Thank you so much. I feel like I had a Homer Simpson moment. Doh! as I
    smack my forehead. :-)

    Eric

  5. #5
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Default Re: ls -al says total 8 on an empty directory

    Happy to help eric. I had to look it up myself as I seldom worry about the number of files in an empty directory.
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •