You are hereForums / Linux World / Linux Support / How to find total size of a directory and all its sub directories in Linux or Unix

How to find total size of a directory and all its sub directories in Linux or Unix


By Koder - Posted on 08 September 2009



The command to find out the total size of a directory, files contained in it and all its subdirectories is as follows:

du -ch | grep total

This will sit chugging for a while and then finally output only the total size of the directory and its subdirectories.

The -c option basically asks it to produce a "grand total" of all the directories. h simply is for human readable and | grep total just outputs the line which has total next to it, omitting everything else

 

AddThis

Popular content

Last viewed: