Purpose

       Displays information about previous logins.

Syntax

       last [ -X ] [ -f FileName ] [ -T Time ] [ -n Number | -Number ] [ Name ... ] [ Terminal ... ]

Description

       The last command displays, in reverse chronological order, all previous logins and logoffs still recorded in
       the /var/adm/wtmp file. The /var/adm/wtmp file collects login and logout records as these events occur and
       holds them until the records are processed by the acctcon1 and acctcon2 commands as part of the daily
       reporting procedures. When the time daemon, timed, changes the system time, it logs entries in wtmp under the
       pseudo-user "date". An entry starting with "date |" is logged before the change, and one starting with "date
       {" is logged after the change. This allows for accurate accounting of logins that span a time change.

 

 

Examples
       1    To display all the recorded logins and logoffs by user root or from the console terminal, type:

            last root console
       2    To display the time between reboots of the system, type:

            last reboot

            The reboot pseudo-user logs in when the system starts again.
       3    To display all the users still logged in at 10.30 am on April 15th, enter:

            last -t 04151030
       4    To display 10 lines in the list, type:

            last -n 10
       5    To display all the recorded logins and logoffs without truncating the user name, type:

            last -X

 

icon phone
Téléphone/Whatsapp : +33 (0)6 83 84 85 74
icon phone