How to find total size of a directory and all its sub directories in Linux or Unix
Submitted by Koder on Tue, 09/08/2009 - 15:24
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
- Add new comment
- 3608 reads
-


Recent comments
1 day 3 hours ago
1 day 4 hours ago
1 week 3 days ago
3 weeks 5 days ago
3 weeks 5 days ago
3 weeks 6 days ago
5 weeks 2 days ago
5 weeks 3 days ago
6 weeks 3 days ago
6 weeks 5 days ago