Discussion Locked

Tailing Users

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have the job of administrating a Linux system and monitoring users. At sometime there are several users on the system and I want to take a peek at what each of them are doing. Something like tail -f , but what?

3 replies

by cpfeiffe

You could set up a history file for each user in their profile if that isn't already done. After that you can list the location of each users history file in a text file that might look like this
/home/user1/.history
/home/user2/.history
When you want to view what each user is donig you can run a script that is set up like this
for FILE in `cat location.txt`
do
echo $FILE #tells you what file you are viewing
echo "" #space for readability
tail -f $FILE #view the current file
echo "" #readability
echo "" #readability
done

This script will tail each file in your location document one at a time. You should pipe the script to more when you run it or redirect the output to another file that you can page through.

Good luck.

This discussion is closed to new replies.