command to get ALL disk used by user? (CLI)

000

Well-Known Member
Jun 3, 2008
355
14
68
Hello,

I find:


but I am no allowed to reply and no't show command to get ALL of user:

MySQL + /home + PgSQL + mail

Logically this command
Code:
du -hs /home/user/
no return ALL space used.


with wich command is possible get this details in servers cPanel?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
5,425
696
313
cPanel Access Level
Root Administrator
Hey hey! If you have quotas enabled the easiest way would be to check the user quota on the machine with this command:

Code:
quota -u username
which will give you output similar to the following:

Code:
Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
  /dev/sda  381940  5120000 5120000           5466       0       0
The "blocks" column, is the actual disk usage on the machine, and in the case of this user it is about 375M.

If you want a command that will return the disk usage for all users on the machine, I would recommend the "whmapi1 get_disk_usage" API call, which will have output similar to the following:

Code:
# whmapi1 get_disk_usage
---
data:
  accounts:
    -
      blocks_limit: ~
      blocks_used: 94865
      inodes_limit: ~
      inodes_used: 3398
      user: user1
    -
      blocks_limit: ~
      blocks_used: 1109666
      inodes_limit: ~
      inodes_used: 9172
      user: user2
    -
      blocks_limit: 5120000
      blocks_used: 382178
      inodes_limit: ~
      inodes_used: 5466
      user: user3
    -
      blocks_limit: ~
      blocks_used: 674248
      inodes_limit: ~
      inodes_used: 6954
      user: user4
Let me know if that helps!