last command
The last command searches through all the files while using it, which in turn gives the details regarding users’ login. This command also protects the server from inside and outside.The basic syntax is “last [ -R ] [ -num ] [ -n num ] [ -adFiowx ] [ -f file ] [ -t YYYYMMDDHHMMSS ] [ name… ] [ tty… ]” and If the user names and tty’s are given, the last command will display the entries, which are matching the arguments.