last, lastb - displays a list of recent user login

Overview

last [-R] [-num] [ -n num ] [-adiox] [ -f file ] [name...] [tty...]
lastb [-R] [-num] [ -n num ] [ -f file ] [-adiox] [name...] [tty...]

description

Last backward search / var / log / wtmp file (you can also use the -f specify the retrieved file option), and display all since that file was created (Sign out) list of users of the system. In the specified user name and the name of the terminal situation, Last display only records that meet these parameters. Terminal name can be abbreviated, thus last 0 is equivalent to Last, tty0 .

When the last captured the SIGINT signal (generated by the interrupt key, usually control-C) or SIGQUIT signal (produced in the Escape key, usually control- \) when, last will show how much it has retrieved the file; the SIGINT signal the case last will terminate.

Each time the system is restarted, the virtual user reboot will be logged. So last reboot will list all the log records log files created since the restart. .PP lastb listed on the default / var / log / btmp log file, this file contains all the bad login attempts. In addition, equivalent to Last .

Options

- NUM Specifies the last to show how many lines.

 " -N   NUM " equivalent  - NUM .
-R does not display the host ranked.
-a shows the hostname in the last column. and is useful when combined with the next option
-d For non-local login, Linux stores not only save the remote host name and IP address (IP number). This option can be the IP address (IP number) is converted into a host name.
-i This option is similar to the display remote host IP address (IP number) of the -d option, but it displays the IP number with numbers and punctuation
-o read a file wtmp old format (with linux-libc5 application writes).
-x display system shutdown logging and run level changes.

note

wtmp and btmp other documents might be found. Only when these files exist, the system only logs information. It is a matter of local configuration. To work these files, you can use a simple command Touch (1) create them (eg, Touch / var / log / wtmp ).

Related documents

/var/log/wtmp.br/var/log/btmp 

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11088642.html