Linux shell script allows us to create the script to check for the login details of any user. To achieve this we will be using the last command. The last is a command-line utility that displays information about the last login sessions of the system users.
echo "Enter the USER NAME : "
Here is the sample output of the above script
More ways to use the last command.
You can to print only the last ten login sessions
You can also use the -p (--present) option to find out who logged into the system on a specific date.
Add paragraph text. Click “Edit Text” to customize this theme across your site. You can update and reuse text themes.