Home Linux Write a shell script to find total number of users and find out how many of them are currently logged in.

Write a shell script to find total number of users and find out how many of them are currently logged in.

35 second read
0
0
107

Write a shell script to find total number of users and find out how many of them are currently logged in.


echo "Total number of users in system are:\n"

who -q

echo "Currently logged in users are:\n"

who | tr -s " " | cut -d " " -f1

Load More Related Articles
Load More By coder coder
Load More In Linux

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also

Prime Or Not Prime vb.net Program.

Prime Or Not Prime . …