Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How to get the total amount of accounts in shell

Discussion in 'General Discussion' started by CoolMike, Mar 16, 2007.

  1. CoolMike

    CoolMike Well-Known Member

    Joined:
    Sep 6, 2001
    Messages:
    307
    Likes Received:
    0
    Trophy Points:
    316
    Hi

    I need a command which tells me how much accounts are on a whm server. If such a command is not existing, a shell script would be also a good solution.

    Hope someone can help me.

    Michael
     
  2. katmai

    katmai Well-Known Member

    Joined:
    Mar 13, 2006
    Messages:
    533
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Brno, Czech Republic
    cat /etc/passwd |wc -l
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,761
    Likes Received:
    116
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    This will show the total number of users on the server, probably some with less meaning (i.e. root, nobody, mailnull, cpanel, mysql, etc).

    To find the total number of cpanel users on the server via shell:

    find /var/cpanel/users -type f -print | wc -l
     
  4. shivinvijai

    shivinvijai Member

    Joined:
    Mar 1, 2007
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    151
    The command to tell the total accounts in a server

    Hi,

    Its better to use /scripts/updateuserdomains first then use the command

    wc -l /etc/trueuserdomains

    will list the number of accounts in the server. If you need a scripts please update me.

    Thanks,
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. CoolMike

    CoolMike Well-Known Member

    Joined:
    Sep 6, 2001
    Messages:
    307
    Likes Received:
    0
    Trophy Points:
    316
    Thanks for all the answers, works perfect!

    Michael
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice