[Reprint] Linux view the user login information -last Linux View user login information -last

Linux view the user login information -last

 
https://www.cnblogs.com/nyatom/p/10297741.html

 

last command:

last command displays the user's most recent login information. Alone last command executed, the read / var / log / wtmp file and displays a list of users logged in to the content of all the file records.

grammar:

last (option) (parameters)

Options:

  • -a: where to log into the system from the host name or ip address, displayed in the last line
  • -d: converts IP addresses to host names
  • -f <log file>: Specifies the log file
  • -n <Display Sequence> / - <shows the number of columns>: Set column lists the number of display list
  • -R: does not display the host name or IP address of the host name of the logged
  • -x: display system shutdown, reboot and change the execution level information

parameter:

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

Actual usage:

View last boot time:

who -b
# 或
last -1 reboot

Check off record:

last -x | grep shutdown # shutdown time period to show

View failed login records:

sudo lastb -i # ip source to display

View the system since last boot time

Uptime 
# or 
w

last command:

last command displays the user's most recent login information. Alone last command executed, the read / var / log / wtmp file and displays a list of users logged in to the content of all the file records.

grammar:

last (option) (parameters)

Options:

  • -a: where to log into the system from the host name or ip address, displayed in the last line
  • -d: converts IP addresses to host names
  • -f <log file>: Specifies the log file
  • -n <Display Sequence> / - <shows the number of columns>: Set column lists the number of display list
  • -R: does not display the host name or IP address of the host name of the logged
  • -x: display system shutdown, reboot and change the execution level information

parameter:

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

Actual usage:

View last boot time:

who -b
# 或
last -1 reboot

Check off record:

last -x | grep shutdown # shutdown time period to show

View failed login records:

sudo lastb -i # ip source to display

View the system since last boot time

Uptime 
# or 
w

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/12118126.html