There are many ways to do this, but the fastest and easiest is to use the 'uptime' command, which will tell you in a summary line how many users are logged in.
There are a series of commands, depending on what and how much information you want on logged in users. The commands are: who w users finger (if installed)
The 'uptime' command will tell you exactly how many users are on the system. There are other variations of this, including counting the number of words from the 'users' command, etc., but this is the easiest.
Use the 'who', 'w', or 'users' command to find out who is logged in.
who command gives the list of users who have currently logged in......
The basic 'who' command lets you see the time of last system boot; list of users logged-in; the current run level, etc.
This has traditionally been a feature of multiuser operating system that the command the system operator uses to command a reboot or shutdown allows the system operator to specify this time interval, then automatically notifies all logged in users to complete what they are doing and log off before that time runs out. Any users failing to log out before the time specified by the system operator expires will be automatically logged out and their tasks killed at the last moment before the system automatically reboots.
users
The command "finger" can tell you how many active shells are used, the users logged in, and where they logged in.
The command is 'wall' (write all). In some systems it can only be executed by the administrator.
There are several commands depending on how much detail you want, and whether or not a certain package is installed on the system. The command 'who', 'w', 'users' will give varying degrees of information on who is logged in. The 'finger' command will also give some information but only if the finger software is installed.
A user may switch their identities when logged in using the 'su' command. On some systems the 'su' command may be restricted.
Well, in the world of Unix, the 'finger' command is like a gentle tap on the shoulder, providing basic information about a user, such as their login name, full name, and the last time they were active. On the other hand, the 'who' command is more like a friendly wave, showing you a list of users who are currently logged into the system, along with details like their usernames and login times. Both commands offer a peek into the community of users on the Unix system, just in different ways.