Linux/Unix: Count All Login Names & Number Of Users Logged On

Fig.02: Displaying and counting all users logged on

Fig.02: Displaying and counting all users logged on

To display only the names and the number of users currently logged on pass the -q option to who command. When this option is used, all other options are ignored by who command. At the bottom you will get total logged on users count. The syntax is:
$ who -q
Sample outputs:

vivek root nixcraft vivek
# users=4

The output in this example indicates that the user named ‘vivek’ has been logged in two times.

Examples and usage: Linux / Unix: who Command Examples To List Users on The Systems