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 last command on Linux system

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Editor to share with you how to use the last command of the Linux system, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Last is a command-line tool that displays information about the last login session of the system user. This command is very useful, especially if you need to track user activity or investigate a possible security breach.

Syntax shell > > last [options] parameter description:

-R omits the hostname field

-num before num presentation

Username displays login messages of username

Tty restriction login message includes terminal code

Example shell > > last-R-2johnney pts/1 Mon Aug 14 20:42 still logged injohnney pts/0 Mon Aug 14 19:59 still logged inwtmp begins Tue Aug 1 09:01:10 2000 # / var/log/wtmpshell > > last-2 mineryminery pts/0 140.119.217.115 Mon Aug 14 18:37-18:40 (00:03) minery pts/0 140.119.217.115 Mon Aug 14 17:22-17:24 wtmp begins Tue Aug 1 09:01:10 2000 General display method

# last brief display, and specify the number of displays

# last-n 5-Rroot pts/4 Thu May 13 17:25 still logged in root pts/2 Thu May 13 17:23-17:25 (00:02) root pts/1 Thu May 13 16:46 still logged in root pts/7 Thu May 13 15:36 still logged in root pts/9 Thu May 13 15:35 still logged in wtmp begins Thu May 13 18:55:40 2014 shows the last column showing the host IP address

# last-n 5-a-iroot pts/4 Thu May 13 17:25 still logged in 192.168.1.10root pts/2 Thu May 13 17:23-17:25 (00:02) 192.168.1.10root pts/1 Thu May 13 16:46 still logged in 192.168.1.10root pts/7 Thu May 13 15:36 still logged in 192.168.1.10root pts/9 Thu May 13 15:35 still logged in 192.168.1. 10wtmp begins Thu May 13 18:55:40 2014 is all the content of the article "how to use last commands in Linux system" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, 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