In CentOS, the last command is used to display the logon status of recent users or terminals. its permission is granted to all users. Run the last command to view the log of the program. The administrator can find out who has tried or attempted to connect to the system. Format: [plain] viewplaincopylast & nb
In CentOS, the last command is used to display the logon status of recent users or terminals. its permission is granted to all users. Run the last command to view the log of the program. The administrator can find out who has tried or attempted to connect to the system.
Format
[Plain]View plaincopy
- Last [-R] [-n] [-f file] [-t tty] [-h node] [-I-IP] [-1] [-y] [ID]
Parameter description
[Plain]View plaincopy
- -R: The field of hostname is omitted.
- -N: number of output records.
- -F file: specifies that the file is used as the log file for query. (The default value is/var/log/wtmp, and/var/log/btmp can display remote login)
- -T tty: only the logon status on the specified Virtual Console is displayed.
- -H node: only the logon status on the specified node is displayed.
- -I IP: only the logon status on the specified IP address is displayed.
- -1: use an IP address to display the remote address.
- -F: displays the year, month, and day of the record.
- -ID: the user name to be queried.
- -X: displays the system shutdown, user logon, and logout history.