민서네집

last , who command 설명 본문

LINUX

last , who command 설명

브라이언7 2015. 6. 19. 14:42

Linux / Unix: last Command Examples


http://www.cyberciti.biz/faq/linux-unix-last-command-examples/


You need to use the last command to show who has recently used the server and logged in and out date/time.


Find out who was logged in at a particular time

The syntax is as follows to see the state of logins as of the specified time:
$ last -t YYYYMMDDHHMMSS
$ last -t YYYYMMDDHHMMSS userNameHere

Linux and Unix who command

[출처] http://www.computerhope.com/unix/uwho.htm

Description

The who command prints information about all users who are currently logged in.

-b--bootDisplay the time of the last system boot.

< 마지막으로 로그인한 기록 보기 >

# last

{login한 계정} pts/2        61.42.208.201    Fri Jun 19 11:07   still logged in   

{login한 계정} pts/0        61.42.208.200    Fri Jun 19 09:23   still logged in   

reboot   system boot  3.5.0-30-generic Fri Jun 19 02:07 - 14:12  (12:04)    


wtmp begins Fri Jun 19 01:57:50 2015


< 시스템의 중요 로그 파일 보기 >

# vi /var/log/syslog

# vi /var/log/syslog.1


< 시스템 로그 파일 보기 >

# vi /var/log/messages


< ssh 로 로그인한 이력 보기 >

# vi /var/log/auth.log


< 2015년 6월 1일 이후로 로그인 한 기록 보기 >

# last -t 20150601000000


< Apache Server Access Log 확인 >

/var/log/apache2/other_vhosts_access.log


Comments