answersLogoWhite

0

Find if the entered user has logged in or not?

Updated: 8/17/2019
User Avatar

Neelakanta

Lvl 1
14y ago

Best Answer

ls -l|tail +2|tr -s " "|cut -d " " -f2,9|sort -n|tail -1

An easier way would be to use the 'finger' command - it will tell you when the user last logged in.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Find if the entered user has logged in or not?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Shell program to show the user name of the user who has logged-into the system?

Use the 'who', 'w', or 'users' command to find out who is logged in.


Can I find whether anyone has logged into my system in my absence?

User History


Which password and user name needs to enter in putty?

The password and user name that should be entered is the one for the remote system user account that the user is accessing, not the password and user name for the computer they are currently logged in to. The administrator of the remote system should be able to provide this information to the user.


How can you find out what user you are logged in as in Linux?

The "whoami" command should show you what account you are currently using.


Who or what is the user called Anonymous on WikiAnswers?

Anonymous is not an actual user, but rather an alias for anyone who contributes to WikiAnswers while not logged in. If the website says "Anonymous" did something, it really means that a user who was not logged in did it. For example, a question asked by "Anonymous" is a question that was asked by a user who is not logged in.


Is the default user the profile that is merged into each user profile when the user is logged on?

Default user


Write a unix shell program to accept a user name and check whether the user logged in or not?

#!/bin/sh echo "Please enter the name of a user:" read USER who|grep $USER > /tmp/usertest & sleep 5 if [ -s /tmp/usertest ] then echo "User is logged in" else echo "User is not logged in" fi rm /tmp/usertest


What is the command of list of user names who have currently logged in?

who command gives the list of users who have currently logged in......


Why are some tasks set to run whether the user is logged in or not?

These would be tasks called 'unattended operation' tasks. If the task does not require user input or is not interactive, then there is no reason for requiring a user to be logged in to execute them.


Do Primary keys have to be numbers that are entered by the user?

Primary keys have to be numbers that are entered by the user.


The logged on user's profile is stored in the registry key?

Hkey_users


To modify smo information view affiliated users and create or modify jcavs user accounts a jcavs user must be logged in as a?

To modify smo information view affiliated users and create or modify jcavs user accounts a jcavs user must be logged in as a?