lastlog Linux Commands

What is Linux lastlog Command?

Explanation

lastlog COMMAND:

lastlog command is used to print the last login times for system accounts. Login information is read from the file /var/log/lastlog.

SYNTAX :


lastlog [options]

OPTIONS:


-t n Print only logins more recent than 'n' days ago..
-u username Print only login information for username.

EXAMPLE:


  1. lastlog -t 5

    Displays the login information, 5 days ago.
  2. last -u username

    Displays the login information for the specified user.

Ask Questions

Ask Question