uptime 및 last reboot

6030 단어 Linux
linux 시스템의 uptime 명령은 주로 호스트의 운행 시간과 linux 시스템의 부하를 조회하는 데 사용됩니다.time 명령은 시스템이 얼마나 실행되었는지 표시할 수 있습니다. 정보는 다음과 같습니다. 현재 시간, 시스템이 얼마나 실행되었는지, 현재 로그인한 사용자가 얼마나 있는지, 시스템이 지난 1분, 5분, 15분 동안의 평균 부하입니다.uptime 명령의 사용법은 매우 간단합니다: uptime를 직접 입력하면 됩니다.또 하나의 매개 변수 - V는 버전을 조회하는 데 쓰인다.(대문자 v 참고) [linux @ localhost] $uptime – V procps version 3.2.7 [linux @ localhost] $uptime 표시 결과: 10:19:04 up 257 days, 18:56, 12 users, load average: 2.10, 2.10, 2.09 표시 내용 설명: 10:19:04//시스템 현재 시간 up 257 days,18:56//호스트가 실행된 시간입니다. 시간이 많을수록 기계가 안정적이라는 것을 의미합니다.12user//유저 연결수는 총 연결수이지 유저수load average//시스템의 평균 부하가 아니다. 최근 1, 5, 15분간 시스템의 평균 부하를 통계하면 시스템의 평균 부하가 무엇일까?시스템 평균 부하란 특정 시간 간격으로 실행되는 대기열의 평균 프로세스 수를 가리킨다.만약 모든 CPU 핵의 현재 활동 프로세스 수가 3보다 크지 않다면 시스템의 성능은 양호하다.만약 모든 CPU 핵의 작업 수가 5보다 많다면, 이 기계의 성능에 심각한 문제가 있을 것이다.만약 당신의 linux 호스트가 듀얼 코어 CPU라면, Load Average가 6일 때 기계가 이미 충분히 사용되었다는 것을 의미합니다.
 
------------------------------------------------------------------------------------
last
NAME

last, lastb - show listing of last logged in users

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

DESCRIPTION
Last searches back through the file /var/log/wtmp (or the file designated by the -f flag) and dis-
plays a list of all users logged in (and out) since that file was created. Names of users and tty's
can be given, in which case last will show only those entries matching the arguments. Names of ttys
can be abbreviated, thus last 0 is the same as last tty0 .

When last catches a SIGINT signal (generated by the interrupt key, usually control-C) or a SIGQUIT
signal (generated by the quit key, usually control-/), last will show how far it has searched through
the file; in the case of the SIGINT signal last will then terminate.

The pseudo user reboot logs in each time the system is rebooted. Thus last reboot will show a log of
all reboots since the log file was created.

Lastb is the same as last , except that by default it shows a log of the file /var/log/btmp , which
contains all the bad login attempts.

OPTIONS
- num This is a count telling last how many lines to show.

-n num The same.

-t YYYYMMDDHHMMSS
Display the state of logins as of the specified time. This is useful, e.g., to determine eas-
ily who was logged in at a particular time -- specify that time with -t and look for "still
logged in".

-f file
Specifies a file to search other than /var/log/wtmp .

-R Suppresses the display of the hostname field.

-a Display the hostname in the last column. Useful in combination with the next flag.

-d For non-local logins, Linux stores not only the host name of the remote host but its IP number
as well. This option translates the IP number back into a hostname.

-i This option is like -d in that it displays the IP number of the remote host, but it displays
the IP number in numbers-and-dots notation.

-o Read an old-type wtmp file (written by linux-libc5 applications).

-x Display the system shutdown entries and run level changes.

NOTES
The files wtmp and btmp might not be found. The system only logs information in these files if they
are present. This is a local configuration issue. If you want the files to be used, they can be cre-
ated with a simple touch(1) command (for example, touch /var/log/wtmp ).

FILES
/var/log/wtmp
/var/log/btmp

AUTHOR
Miquel van Smoorenburg, miquels AT cistron.nl

SEE ALSO
shutdown(8) , login(1) , init(8)
-----------------
last reboot


좋은 웹페이지 즐겨찾기