Linux basic commands -last

last command

last command is used to display the user last logged information. The last command execution alone, it reads the /var/log/wtmpfile and displays the list of all users logged in to the file of the contents of the records out.

grammar

Last (option) (parameters)
Options
- A: where the sign system ip address or the host name, displayed in the last line;
 - D: converting a host name into an IP address;
 -f <log file> : Specifies the log file.
-n <shows the number of columns> or - <column shows the number> : Set list lists the number of display columns;
 - R & lt: does not display the host name or IP address of the logged in;
 the -X-: System Shutdown, reboot, and performing change the level of other information.

parameter

  • User Name: Displays the user registration list;
  • Terminal: login from the list of designated terminals.

Examples

last command to display the user login, the following is a record of the number of fixed lines displayed directly:

last -10
root     pts/0        221.6.45.34      Tue Dec 17 09:40   still logged in
root     pts/0        221.6.45.34      Mon Dec 16 09:00 - 11:57  (02:56)
root     pts/0        222.94.97.122    Sun Dec 15 20:39 - 23:28  ( 02 : 48 ) 
root pts / 0         222.95 . 209.80     Sat Dec 14,  14 : 39 - 14 : 58   ( 00 : 18 ) 
root pts / 0         221.6 . 45.34       Thu Dec 12,  16 : 55 - 17 : 37   ( 00 : 41 ) 
root pts / 0         49.65 . 139,195     Wed Dec11 20:40 - 21:16  (00:35)
root     pts/0        49.65.139.195    Wed Dec 11 19:46 - 20:03  (00:17)
root     pts/0        221.6.45.34      Tue Dec 10 14:41 - 15:52  (01:10)
root     pts/ 0         221.6 . 45.34       Mon Dec   9  17 : 24 - 17 : 30   ( 00 : 06 ) 
root pts / 0         221.6 . 45.34       Mon Dec   9  09 : 38 - 11 : 41   ( 02 : 02 )

 

Guess you like

Origin www.cnblogs.com/lj7xun/p/10983236.html