Tuesday, 21 April 2015

Write a shell program to display a sorted list of the logged in users ​

Shell script to display the sorted list of logged in user names:
In unix, there may be multiple users work together. This script helps one to know or share the things to other user who logged in to the same server. The "who" command will prints information about all users who are currently logged in. 
By using "who" we will get the NAME TERMINAL TIME IP information  But we only need usernames hence we use grep command to show required information.


echo "List of logged in users are:"
who | cut -d " " -f 1


No comments:
Write comments

Featured post

List of Universities in Karnataka offering M.Sc Computer Science

The post-graduate programme in Computer Science (M.Sc Computer Science) contains two academic years duration and having a four semesters....

Popular Posts

Copyright @ 2011-2016