Routing the world

Routing & IT System Administration

Archive for August 2009

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

%d bloggers like this: