uptime和last reboot

linux系统中的uptime命令主要用于获取主机运行时间和查询linux系统负载等信息。
uptime命令可以显示系统已经运行了多长时间,信息显示依次为:现在时间、系统已经运行了多长时间、目前有多少登陆用户、系统在过去的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             //主机已运行时间,时间越大,说明你的机器越稳定。
12 user                              //用户连接数,是总连接数而不是用户数
load average                      // 系统平均负载,统计最近1,5,15分钟的系统平均负载
那么什么是系统平均负载呢? 系统平均负载是指在特定时间间隔内运行队列中的平均进程数。
如果每个CPU内核的当前活动进程数不大于3的话,那么系统的性能是良好的。如果每个CPU内核的任务数大于5,那么这台机器的性能有严重问题。
如果你的linux主机是1个双核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


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值