#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Location
    Somewhere in the desert of Arizona
    Posts
    63
    Rep Power
    13

    command for directory size


    Hi there,

    Pls bear with me, I'm a non-UNIX person...

    I'm using RH Linux 6.2 and need to know the total size of a directory, including all the subdirectories and their files beneath it.

    The only command I've found is ls -l, but it doesn't give me the complete size of all subdirectories, just the size of the "directory" (i.e., they're all the same) itself and shows it in blue.

    I've also seen du, but all of the commands in help just give me a huge list of each file with their sizes. I need a grand total size of everything in the directory.

    Is there a command for this?

    Thanks in advance!
    Last edited by wisconsinative; April 29th, 2002 at 06:52 PM.
  2. #2
  3. No Profile Picture
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Location
    The Emerald City
    Posts
    289
    Rep Power
    13
    assuming that the directory that you want to know the size of is called 'mydir' and you're in the directory which contains 'mydir'.

    du -h mydir | grep mydir$
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Location
    Somewhere in the desert of Arizona
    Posts
    63
    Rep Power
    13
    exactly what I needed. Thank you!!!

IMN logo majestic logo threadwatch logo seochat tools logo