Routing the world

Routing & IT System Administration

Linux: Directory Space Calculation

leave a comment »

Sometimes is usefull to know how much space is a directory using.

This commands tells you:

—> Gives the full amount of size included subdirectories in human readable format.
du -sh

—> Gives a sorted list of directories and its space allocation.
du -s * .[a-zA-Z0-9]* | sort -n | less

—> Gives the space amount used by all files of a user (Change $USER for yours).
find / -printf "%u %s\n" -user $USER | awk '{user[$1]+=$2}; END{ for( i in user) print i " " user[i]}'

Advertisements

Written by Root

August 19, 2009 at 09:38

Posted in Linux

Tagged with

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: