RSS Feed
Jul 2

Useful little bit of code – List all domains on cPanel server

Posted on Thursday, July 2, 2009 in cpanel

Need to list all domains on the server (no subdomains, etc)?

Here’s the magical code:

cat /etc/userdomains | awk -F ':' '{ print $1 }' | sed 's/.*\.\(.*\.\)/\1/' | sort -u

Bring on the comments

  1. Jim says:

    This doesn’t seem to see .co.uk domains

Leave a Reply