Category: System Administration

You have an unmanaged VPS server and have a script that creates users?

It's always good to know the number of users that your Linux server has.

If you have a control panel it would be easier to find out the number of users.

You can use this command to get the number of users. It will read the the contents of /etc/passwd file which stores the user list and then we'll use the wc command to count the lines. wc normally counts words but by passing -l parameter it will count the lines.

The first 10-15 lines of the /etc/passwd file contain system users such as root, cron etc.

cat /etc/passwd | wc -l

Photo credit: Gabriel Heinzer @6heinz3r on unsplash

Join our mailing list

Get important news about cool products we release and invitations to beta test new products
Do you want a deal? Get ALL Orbisius Premium Plugins at one small price. See the Plugin Bundle