How to use this in command-line interface?

It’s simple. Do the following steps:

1. SSH to server.

2. Execute the command as follows:

whmapi1 listaccts search=username searchtype=user


If you do not specify a value for both the “searchtype” and “search” parameters, the function returns all of the server’s accounts. By using these parameters, you will get a clean output as you are expecting.

From this command, we can findout almost all details about a particular cpanel user without log into the cPanel/WHM user interface.

We will get the details about backup, disklimit, diskused, domain, email, inodeslimit, inodesused, details about ip (both ipv4 and ipv6), email accounts related stuffs (like mailbox_format, max_defer_fail_percentage, max_email_per_hour), accounts limits (like maxaddons, maxftp, maxlst, maxparked, maxpop, maxsql, maxsub), email accounts’ status (outgoing_mail_hold, outgoing_mail_suspended), current plan, account suspension details (suspended, suspendreason, suspendtime) and some core information (owner, partition, shell, startdate, theme, uid, unix_startdate, user etc) etc in a single line command.

How to list disk quota allocated and current usage quickly?


We can simply grep it out from the above command. See the syntax pasted below:

# whmapi1 listaccts search=rootadminz searchtype=user| grep disk
      disklimit: 5120M
      diskused: 1417M


# whmapi1 listaccts search=rootadminz searchtype=user want=diskused
      diskused: 1417M


How to check inode limit and current usage for a single cPanel account via command line?


Use the following commands to get the idea about inode usages:

# whmapi1 listaccts search=rootadminz searchtype=user| grep inode
      inodeslimit: unlimited
      inodesused: 16318


# whmapi1 listaccts search=rootadminz searchtype=user want=inodesused --- data: acct: - inodesused: 16318

You can use the parameter “want” to fetch details separately.

Was this answer helpful? 0 Users Found This Useful (0 Votes)