Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to find per-user disk-space-usage?

Tags:

c

linux

unix

I am writing a small tool in which I require to find per-user File-system-memory-usage.

I have to do some clean up activity if file-system usage is crossing certain threshold value. What is the system call that I can use, so that I could be able to find per user memory usage?

like image 744
Whoami Avatar asked Feb 13 '12 11:02

Whoami


1 Answers

A simplistic approach would be

du -shc /home/*

To sort it:

du -smc /home/* | sort -n

There is also a wellknown Perl script that has the option of mailing disk usage reports per user: durep

  • http://www.ubuntugeek.com/create-disk-usage-reports-with-durep.html
like image 143
sehe Avatar answered Sep 21 '22 17:09

sehe