Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the lastlog command of Linux

Shulou Source: shulou.com Published: 2022-06-01 22:02:21 10月02日 Update

This article mainly introduces the relevant knowledge of "how to use the lastlog command of Linux". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to use the lastlog command of Linux" can help you solve the problem.

The Linux common command lastlog command is used to display the last login information of all users in the system.

Lastlog displays the last login information of all users in the system

Add that the lastlog file is queried every time a user logs in. You can use the lastlog command to check when a particular user last logged in and format the contents of the last login log / var/log/lastlog output. It displays the login name, port number (tty), and last login time, sorted by UID. If a user has never logged in, lastlog displays * * Never logged**. Note that you need to run the command as root.

Syntax lastlog (option) option-b: display login information before the specified number of days;-h: display help information for the summoning order;-t: display login information since the specified number of days;-u: display the most recent login information for the specified user. Instance lastlog Username Port From Latest root pts/0 221.6.45.34 Tue Dec 17 09:40:48 + 0800 2013 bin * * Never logged in** daemon * * Never logged in** adm * * Never logged in** lp * Never logged in** sync * * Never logged in** shutdown * * Never logged in** halt * * Never logged In** mail * Never logged in** news * * Never logged in** uucp * * Never logged in** operator * * Never logged in** games * * Never logged in** gopher * Never logged in** ftp * * Never logged in** nobody * * Never logged in** vcsa * * Never logged in** ntp * Never logged in** sshd * * Never logged in** nscd * * Never logged in** ldap * * Never logged in * * postfix * Never logged in** www * * Never logged in** mysql * * Never logged in** 's content on "how to use the lastlog command of Linux" ends here. Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Tags: Login command information user knowledge content days time display system system industry secondary login help different practical never slogan example practicality actual Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB OPPO Reno Shulou Technology Linux Huawei