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'. 
5322333/2^20
5
quit

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

Leave a Comment

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

WordPress.com Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

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