If you want to cancel account from the command line instead of via the WHM, you can do so with one of the following commands.
Pre CentOS 7:
/scripts/killacct
CentOS7:
/scripts/removeacct
Both scripts use the same syntax:
/scripts/removeacct
--user=username [options]
OPTIONS
–force
Bypass the confirmation step in the script and immediately terminate the account.
Example: /scripts/removeacct --user=username --force
–keepdns
Retain the account’s zone files from the DNS server when the script terminates the account.
Example: /scripts/removeacct --user=username --keepdns