Tuesday 11 November 2008

Who is online?

Many system administrators use scripts to help them in the process of managing a server. A common problem is finding out exactly what users are on the system and what they are doing. Several tools are available on the system to see who is online, what processes are running, and pipeing them together can resolve many problems. Here are 2 small scripts that will show, first if a user is online, and then what he is running:

who | grep $1

ps -aux | grep $1

The variable $1 here means the first command line argument, from a shell script. The who command first checks if the user is online, then ps will show all the processes currently running under that user's UID.

Reference : Suse Linux - 100 tips and tricks by Patrick Lambert

0 comments:

by TemplatesForYouTFY
SoSuechtig