Usage of last command in Linux system

Source: Internet
Author: User

1. Role
The last command in a Linux system is a display of recent user or terminal logins, and its use rights are for all users. Using the last command to view the logof the program, the administrator can tell who has or attempted to connect to the system.

2. format

Last [-R] [-n][-F file][-t TTY] [-H node ] [-i-ip][-1 [-Y][id]

3. Main Parameters

-R: omit fields from hostname

-n: Specifies the number of bars for the output record.

-Ffile: Specifies the log file used as the query for the file .

-t TTY: Displays only the specified Virtual Console login status.

-H node: Displays only the login status on the specified node.

-i IP: Displays only the status of the login on the specified IP .

-1: Use IP to display the remote address.

-y: Displays the year, month, and day of the record.

-ID: Knows the user name of the query.

-x: shows the history of system shutdown, user login, and exit.

Example:
Shell>> Last-r-2
User3 PTS/1 Mon 20:42 still logged in
User3 pts/0 Mon 19:59 still logged in
Wtmp begins Tue 1 19:01:10 # # #/var/log/wtmp

Shell>> Last-2 User1
User1 pts/0 140.119.217.115 Mon 14 18:37-18:40 (00:03)
User1 pts/0 140.119.217.115 Mon 14 17:22-17:24 (00:02)
Wtmp begins Tue 1 19:01:10 2007

Usage of last command in Linux system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.