Linux Display Date And Time Of Login

You can use the last command to view the date and time of the last login.

  1. Open a terminal window.
  2. Type the following command: last
  3. Press Enter.

This will display a list of recent logins, including the date and time of each login. The output will look something like this:

username pts/0 192.168.0.10 Fri Feb 18 09:43 still logged in
username tty1 Thu Feb 17 17:32 - 09:50 (16:17)
reboot system boot 5.4.0-90-generic Thu Feb 17 17:30 still running

The first column shows the username that was used to login, the second column shows the terminal or device that was used, and the third column shows the IP address or hostname of the machine that was used to login. The fourth column shows the date and time of the login. (https://spoonerberries.com)

If you only want to see the last login for a specific user, you can use the following command, replacing “username” with the actual username:

last username

This will display only the last login for the specified user.

Leave a Comment