finding disk usage totals in unix

aDub

Junior Member
Mar 18, 2002
22
0
0
Im stuck in a rut here. How do you find out how much space a given user is using in unix? I have a project for school and I have to write a shell script that gets usernames from a text file and gets the disk usage for that user. Thanks for any help.
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
"man du" as long as they keep their stuff in a specific directory. otherwise you're going to have to find all files they own, and I dont know any easy way to do that. of course, *nix probably has user quota support somewhere, i've just never seen it. ;)
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: CTho9305
"man du" as long as they keep their stuff in a specific directory. otherwise you're going to have to find all files they own, and I dont know any easy way to do that. of course, *nix probably has user quota support somewhere, i've just never seen it. ;)

quota support exists. But it wont help this problem.

find / -user n0cmonkey -name example.html -print should find the file example.html owned by the user n0cmonkey.

And all of each users' files should be in specific directories... Their home directories.