Linux Admistration
Which commands do you use to output the current users logged into the system and accessing a specific file?
|
who
this command will list all users logged in on your system. ps aux | grep <username> this will list all process by the username you supply |
This command (lsof | grep <filename> | cut -c 21-27 | sort -u) will do it. Example
Code:
$ lsof | grep /tmp | cut -c 21-27 | sort -u |
Adminstrative
suppose you want to write a shell-script that outputs a periodic listing of owners of files that are active at given times during the day, so as to monitor who was logged in when some particular event occurred e.g when someone changed the contents of files, how would you achieve this ? please help!
|
Quote:
|
I have merged your two closely-related threads. Please keep one thread per topic---thanks
|
All times are GMT -5. The time now is 04:36 PM. |