Administration
HI
How do we check if a particular user has logged off. I only know how to check if a user logged in either by using who, w or last but don'thave an idea of how to check if a user has logged off. Any idea? |
you can check doing:
last <username> and that will list all the sessions od that user. hope that helps |
I don't quite see what your problem is...
Code:
who -u | grep "user" Or am I misunderstanding you? |
Quote:
when using last to check those who logged in, it indicates that by a phrase "still logged in" and I want to know how i can see if one of the users who logged in has logged off/out. Thanks |
who -u |grep -i "user"> /dev/null
if [ $? -eq 0 ]; then echo "User is Logged In"; else { echo "User Logged Off" } fi Also note if user is never logged in then also it will say User logged off |
All times are GMT -5. The time now is 10:06 AM. |