Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Aug 2005
    Peterborough, UK

    Size of a Directory Tree

    Is there an easy way to find out the size of the contents of a directory and all it's sub-directories from the command line?

    Thanks in advance,
    \"I am, after all,\" said Pooh, \"a bear of very little brain.\"
    MY PC: Athlon XP64 3000+ on a Asus K8V-X mobo w/1GB of non-descript RAM. AGP - GeForce 2 MX400. PCI - Creative Live! 5.1 soundcard. 140 GB and 120 GB SATA WD drives.

  2. #2
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    If you have /home/foo and you want to find out it's size do
    du -h /home/foo
    and it will spit out the size
    Registered Linux User #371543!
    Get force-get May The Source Be With You

  3. #3
    This old post was the top result today when googling "linux directory tree size" - thanks! I'd like to add that adding an -s switch gives a one-line summary total:

    # du -hs /var/www/html
    203M    html
    - r

  4. $spacer_open

Posting Permissions

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