Библиотека сайта rus-linux.net
7.3. Monitoring Users
Just because you're paranoid doesn't mean they AREN'T out to get you... Source Unknown
From time to time there are going to be occasions where you will want to know exactly what people are doing on your system. Maybe you notice that a lot of RAM is being used, or a lot of CPU activity. You are going to want to see who is on the system, what they are running, and what kind of resources they are using.
7.3.1. The who command
The easiest way to see who is on the system is to do a
who or w. The -->
who is a simple tool that lists out who is logged -->
on the system and what port or terminal they are logged on at.
|
7.3.2. The ps command -again!
In the previous section we can see that user aweeks is logged
onto both
From this we can see that the user is doing a ps
ssh.
pts/1
and pts/2
,
but what if we want to see what they are doing? We could to a
ps -u aweeks and get the following output
|
This is a much more consolidated use of the ps than discussed previously.
7.3.3. The w command
Even easier than using the who and
ps -u commands is to use the w.
w will print out not only who is on the system,
but also the commands they are running.
|
From this we can see that I have a kde session running, I'm working in this document :-), and have another terminal open sitting idle at a bash prompt.