Find the answer to your Linux question:
Results 1 to 2 of 2
I am new to Linux as a sis admin and i know that the i am using "Amazon Linux AMI release 2012.09" but i want to know how big are ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    6

    How to tell how big each folder is?


    I am new to Linux as a sis admin and i know that the i am using
    "Amazon Linux AMI release 2012.09"

    but i want to know how big are each directory in my root. So far i have

    du -a ./ | sort -n -r | head -n 100

    returns
    Code:
    3817508 ./
    458228  ./moises/
    201668  ./moises/vendor
    201536  ./moises/vendor/cache
    but really just want to know that the moises/ directory is 458228

    and i dont know if that is kb or Gb

    also is there a way to remove sub directorys?

    Thanks

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,199
    If you only want the first two lines of your output, use head -2 as your final filter.

    The units are bytes by default. If you want something more practical, use du -h. This will use suitable units depending on the size of the file and show which ones have been used.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

Posting Permissions

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