Sungju's Slow Life

Personal journal

Check how much is used up by a specific user

You can use below command to check how much space is consumed by a specific user (‘testuser’ in this case).

$ cd /
$ find . -user testuser -type f -exec du -k {} ; | awk '{ s = s + $1 } END { print "Total used: ", s }'

Total used: 5322333

You can easily convert this to GB with the following commands.

$ bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 

So, in this case, ‘testuser’ consumed about 5GB of space.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

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

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: