help understanding this command
Hi there!
does any one have an idea of how I would sum up the total disk space use by a user's files in a particular directory. for example, say I wanna find out the total disk space use by user samy in the /var/ directory.. thanks |
Hmmm ... good question. Maybe something like:
find . -user <username> -type f -ls | awk 'BEGIN {total=0} {total += $7} END {print total}' would work. Of course, if /var is its own partition, and you have the quota utilities installed, you can just use repquota. If you're going to try to limit the amount of disk users can use, that's probably the way to go. |
Re: help understanding this command
Quote:
|
Re: Re: help understanding this command
Quote:
Cheers, Tink |
vince_2x
Oh thanks a lot btmiller.. this is exactly what I wanna do .. somehow I did modify the command a bit to get precise results.. somethink like
find /var/ -user $USER -type f -exec du -s -k -h {} \; | awk 'BEGIN {total=0}{total += $1}END{print total} ^^^^^^^^^^^^^^ thanks a lot |
All times are GMT -5. The time now is 12:08 AM. |