OK, I'm guessing you're using
bash as your standard shell and nobody has changed it. In that case, this should show you the registered human users:
- cat /etc/passwd | grep /bin/bash | cut -d: -f1
If you just want the number of users, use
- cat /etc/passwd | grep -c /bin/bash
instead.
If you don't know if any of your users have changed their shell, you can also try this:
- cat /etc/passwd | grep /home | cut -d: -f1
which will list all users who have a home directory in
/home/. This can be changed too, but it's the standard. Again, you can count them by using
- cat /etc/passwd | grep -c /home
If you want to list all users, no matter if human or not,
- cat /etc/passwd | cut -d: -f1
will do the job. However, as there are quite a few users created for system processes, this list will be long. Again,
- cat /etc/passwd | grep -c :
only gives you the amount of users.
Greetings,
Nepomuk