Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the lastlog command of Linux

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the Linux lastlog command how to use the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe you will have something to gain after reading this Linux lastlog command how to use the article, let's take a look.

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

Command format usage: lastlog [options] Common options:-b,-- before DAYS only prints recent login records earlier than DAYS-C,-- clear clear lastlog record of an user (usable only with-u)-h,-- help displays this help information and launches-R -- the directory root CHROOT_DIR chroot went to-- S,-- set set lastlog record to current time (usable only with-u)-t,-- time DAYS prints only the most recent login records later than DAYS-u,-- user LOGIN prints the most recent login records of LOGIN users 12345678 reference example shows the last login information of all users in the system.

[root@itcast ~] # lastlog displays login information before the specified number of days

[root@itcast ~] # lastlog-b 7 displays login letters since the specified number of days

[root@itcast ~] # lastlog-t 7 username port from the last login time root pts/0 August 3 10:27:37 + 0800 2019 deng pts/0 172.16.0.51 June August 3 10:27:30 + 0800 2019 itcast pts/1 March July 31 21:25:50 + 0800 2019 [root@itcast ~] # displays the most recent login information of the specified user

[root@itcast ~] # lastlog-u root username port from the last login time root pts/0 August 3 10:27:37 + 0800 2019 [root@itcast ~] # clear the login information of the specified user

[root@itcast ~] # lastlog-C-u root [root@itcast ~] # [root@itcast ~] # [root@itcast ~] # lastlog-u root username port from the last login time root * * never logged in * * [root@itcast ~] # about "how to use the lastlog command of Linux" this This is the end of the article. Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to use Linux's lastlog commands". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report