Nk_user_disk_usage
Description
Get disk usage stats for every user.
Example
[root@cloudvpsserver ~]# nk_user_disk_usage User │ Homedir │ Disk-Usage Quota │ nkern │ /home/nkern │ 6.4M none │
Code
nk_user_disk_usage() { gen_user_disk_body() { echo "User │ Homedir │ Disk-Usage Quota │" for user in $(nk_list_all_users); do homedir="$(grep -E "^$user" /etc/passwd | awk -F ":" '{print $(NF-1)}')" disk_usage="$(du -hs "$homedir" | awk '{print $1}')" quota="$(quota "$user" | awk '{print $NF}')" echo "$user │ $homedir │ $disk_usage $quota │" done | sort -rh -k 5 } gen_user_disk_body | column -t }