Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Size of directories - what does it mean ?

    List,

    (My 1st post)

    In my linux system, I have a directory called /data .
    When I do a ls -lrt is get a small list of files and directories with the various info about them.
    The sizes of the (sub)directories (called /logs /local and /dda) are all 4096.
    Inside of these directories, they are either empty or stuffed with huge amounts of other files.
    Question...What does the original 4096 tell me ? It seems to have no bearing on the size of what is inside.
    I did an 'info ls' and 'man ls' but the answer didn't seem to be in there.

    Thanks.




  2. #2
    Join Date
    May 2012
    Location
    West Byfleet, Surrey, UK
    Posts
    21
    Thanks
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Post

    Hiya.

    Let me try to spell this out simply...


    • A file contains whatever data is put in it
    • A directory contains the names of the files that are listed in it - and their inode numbers
    • An inode contains metadata describing a file (or directory - in linux/unix, *everything* is a file). This includes:


    • the size of the file,
    • the file's physical location (i.e., the addresses of the storage blocks containing the file's data on disk)
    • the file's owner and group
    • the file's access permissions
    • timestamps telling when the inode was created, last modified and last accessed
    • a reference count telling how many hard links point to the inode.



    So, an inode has a fixed size of 1024, which is sufficient to contain all the above

    Clear?

    Probably not, so I'll guess that what you really wanted was a way to figure out the size of the stuff in the directory?

    in which case...
    Code:
    cd <to the directory you are interested in>
    du -sh *
    if you have a directory with a lot of files, you might want to use these:
    Code:
    du -sh * | sort -n                 # to the end of that command, or if you're looking for large files...
    du -sh * | egrep '[0-9]G'  | sort -n  # which will (almost always) only show files with more than 1Gb in.
    


    Feel free to ask for clarification or further Q's



    Last edited by hackinjack; 02-10-2013 at 03:04 PM.

  3. #3
    Join Date
    Dec 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks for the reply. Your explanation was clear to me.
    There are other directories in my system that have other sizes (4096 and 32768) so I just
    thought that those were the 'fuller' directories, but instead, they must be more 'complex' directories.

    Thanks again,
    PO

 

 

Similar Threads

  1. Replies: 1
    Last Post: 02-29-2012, 05:09 AM
  2. Replies: 0
    Last Post: 12-10-2011, 08:52 PM
  3. Replies: 6
    Last Post: 11-28-2011, 01:10 PM
  4. The Increasing Size Of The Linux Kernel
    By Fred in forum Linux News
    Replies: 0
    Last Post: 11-12-2011, 09:42 PM
  5. Replies: 0
    Last Post: 10-29-2011, 08:52 AM

Bookmarks

Posting Permissions

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








Check out Linux Central for Linux software and other goodies!





» Stats

Members: 3,588
Threads: 3,921
Posts: 9,452
Top Poster: Fred (1,486)
Welcome to our newest member, newtolinux

» Links



Powered by vBadvanced CMPS