In Linux systems, the last and LASTB commands are used to list information about the user who is currently logged in to the system. Directive English original meaning:
Last, lastb-show listing of the last logged in users
When the last instruction is executed separately, it reads the file located in the /var/log/wtmp and displays all the user lists of the logged on system to the file's content record.
Executes the LASTB instruction separately, it reads the file located in the /var/log/btmp , and displays the list of users logged in to the system that failed to log on to the file.
First column information: User name, or display reboot (startup or restart operation will be recorded here as reboot)
Second column information: End location, pts/0 (pseudo terminal or virtual terminal) means a user from a remote connection such as SSH or Telnet.
TTY (teletypewriter) means that a user connected directly to a computer or locally connected, if it is a start or restart operation, will be displayed as system boot
Third column information: login IP or kernel, if you see: 0.0 or Nothing , this means that the user is connected via a local terminal.
There is also the information in the status display kernel version, I guess these records should belong to the operation of the system, such as boot, shutdown, restart and other operations
Fourth column information: Start time, where the date format is day + "%a%b%d"
Fifth column information: End time (still login in has not exited down until normal shutdown crash until forced shutdown)
Sixth column information: Duration
================================================================================
The parameters of the last command are supplemented with instructions (the following parameters are also appropriate for the LASTB command):
Parameter:-a the host name or IP address from which to log in to the system, displayed in the last line;
-D converts the IP address to the host name. When a user logs in to the system from a remote location other than a local host, the log is not only the host name, but also the IP address of the remote host.
By default, the remote host is displayed with an IP address, which can be replaced with the host name;
-f Specifies the record file. The default last instruction will read the Btmp file in the/var/log directory;
-N Sets the number of displayed columns for the list, and if you only want to query the last 10-digit user name of the system, set the number of displayed columns to "10".
To query the last 30 users, then set to "30", and so on;
-R does not display the host name or IP address of the login system;
-X displays information such as system shutdown, reboot, and execution level changes.
Respect for the work of others reproduced please be sure to indicate the source: http://www.cnblogs.com/5201351/p/5139677.html
Linux next last and Lastb command detailed