有的时候需要搜集服务器的各种信息,比如cpu信息,内存信息,linux版本信息,安装的各种软件信息等等。下面总结几种主要指标的查看方法。

1. 查看Linux发行版信息
[root@pcmweb ~]# cat /etc/issue
Red Hat Enterprise Linux Server release 5 (Tikanga)
Kernel   on an m
2.查看Linux内核信息
[root@pcmweb ~]# uname -r
2.6.18-8.el5xen
3.查看cpu信息
[root@pcmxexdb ~]# cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Intel(R) Xeon(R) CPU           X5450  @ 3.00GHz
stepping        : 6
cpu MHz         : 2992.540
cache size      : 6144 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 4
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm
bogomips        : 5989.06
clflush size    : 64
cache_alignment : 64
address sizes   : 38 bits physical, 48 bits virtual
power management:
 
processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Intel(R) Xeon(R) CPU           X5450  @ 3.00GHz
stepping        : 6
cpu MHz         : 2992.540
cache size      : 6144 KB
physical id     : 1
siblings        : 4
core id         : 0
cpu cores       : 4
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm
bogomips        : 5985.40
clflush size    : 64
cache_alignment : 64
address sizes   : 38 bits physical, 48 bits virtual
power management:
 
processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Intel(R) Xeon(R) CPU           X5450  @ 3.00GHz
stepping        : 6
cpu MHz         : 2992.540
cache size      : 6144 KB
physical id     : 0
siblings        : 4
core id         : 1
cpu cores       : 4
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm
bogomips        : 5985.02
clflush size    : 64
cache_alignment : 64
address sizes   : 38 bits physical, 48 bits virtual
power management:
 
。。。。。。。。。。。。。。。。。。(省略若干行) 
processor       : 7
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Intel(R) Xeon(R) CPU           X5450  @ 3.00GHz
stepping        : 6
cpu MHz         : 2992.540
cache size      : 6144 KB
physical id     : 1
siblings        : 4
core id         : 3
cpu cores       : 4
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm
bogomips        : 5985.29
clflush size    : 64
cache_alignment : 64
address sizes   : 38 bits physical, 48 bits virtual
power management:

这样显示出来的信息很复杂,不容易看出结果。其实上面一大篇中有用的信息只有2条(processor和physical id)可以用命令来简化一下。命令如下:

physical id (如下,代表这个机器一共有2个cpu,0是一个,1是一个)

[root@pcmxexdb ~]# cat /proc/cpuinfo |grep "physical id"
physical id     : 0
physical id     : 1
physical id     : 0
physical id     : 1
physical id     : 0
physical id     : 1
physical id     : 0
physical id     : 1

processor(如下,表示一共有8个核)

[root@pcmxexdb ~]# cat /proc/cpuinfo |grep processor
processor       : 0
processor       : 1
processor       : 2
processor       : 3
processor       : 4
processor       : 5
processor       : 6
processor       : 7

综上,这个机器一共有2个4核的CPU。

4.查看内存信息
[root@pcmxexdb ~]# cat /proc/meminfo 
MemTotal:      8174388 kB
MemFree:       4130912 kB
。。。。。。。。。。。。。。(省略若干)
SwapTotal:     8393952 kB
。。。。。。。。。。。。。。

一共8G内存,8G的swap空间。

5.查看硬盘信息
[root@pcmweb ~]# fdisk -l
 
Disk /dev/sda: 1499.8 GB, 1499883110400 bytes
255 heads, 63 sectors/track, 182350 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14      182350  1464621952+  8e  Linux LVM

硬盘空间一共是1.5T左右。

6.查看分区信息
[root@pcmweb ~]# df -h
文件系统              容量  已用 可用 已用% 挂载点
/dev/mapper/VG00-LV04
                      307G  5.0G  286G   2% /
/dev/sda1              99M   12M   82M  13% /boot
tmpfs                 3.9G     0  3.9G   0% /dev/shm
/dev/mapper/VG00-LV03
                      757G  2.1G  716G   1% /ftp
/dev/mapper/VG00-LV01
                      3.9G  137M  3.6G   4% /tmp
/dev/mapper/VG00-LV02
                      284G  541M  269G   1% /usr/local

查看Linux服务器各种信息方法的更多相关文章

  1. 查看linux服务器内存信息

    查看服务器内存信息 dmidecode|grep -P -A5 "Memory\s+Device"|grep Size [root@localhost home]# dmideco ...

  2. 安装MegaCli,查看linux服务器raid信息

    1.下载安装包 下载地址:https://raw.githubusercontent.com/crazy-zhangcong/tools/master/MegaCli8.07.10.tar.gz 2. ...

  3. 使用 dmidecode 查看Linux服务器信息

    使用 dmidecode 查看Linux服务器信息 来源  http://www.laozuo.org/6682.html 对于大部分普通服务器用户来说,我们选择VPS.服务器产品的时候比较关心的是产 ...

  4. Linux 服务器的网络配置 - 2. 查看 Linux 服务器的进程

    2. 查看 Linux 服务器的进程 1)ps [主要选项] -a  显示系统中所有进程的信息 -e  显示所有进程的信息 -f  显示进行的所有信息 -l   以长格式显示进程信息 -r  只显示正 ...

  5. Linux 服务器的网络配置 - 1. 查看 Linux 服务器的网络连接

    1. 查看 Linux 服务器的网络连接 1)查看主机名: liuqian@ubuntu:~$ hostname ubuntu 2)查看 ip 地址: 用 ifconfig 即可,这里介绍命令组合用法 ...

  6. 如何查看LINUX 硬件配置信息

    如何查看LINUX 硬件配置信息 在网上找了N久,发现了一篇不错的文档,转载一下: 1.查看机器所有硬件信息: dmidecode |more dmesg |more 这2个命令出来的信息都非常多,所 ...

  7. 通过浏览器查看nginx服务器状态配置方法

    通过浏览器查看nginx服务器状态配置方法 投稿:junjie 字体:[增加 减小] 类型:转载 这篇文章主要介绍了通过浏览器查看nginx服务器状态配置方法,本文讲解开启nginx-status的配 ...

  8. 查看Linux服务器CPU总核数

    下面介绍查看Linux服务器CPU总核数的方法. 通过/proc/cpuinfo可查看CPU个数及总核数. [root@kevin ~]# grep processor /proc/cpuinfo | ...

  9. 如何使用Linux命令行查看Linux服务器内存使用情况?

    一个服务器,最重要的资源之一就是内存,内存够不够用,是直接关系到系统性能的关键所在. 本文介绍如何查看Linux服务器内存使用情况, 1.free命令 free -m [root@localhost ...

随机推荐

  1. nRF51822之pstorage使用摘要

    https://devzone.nordicsemi.com/question/15271/how-can-i-write-10kb-of-data-to-internal-flash/?answer ...

  2. windbg sos版本不匹配问题解决

    dumpheap 时提示: 0:105> !dumpheap -stat The garbage collector data structures are not in a valid sta ...

  3. SIP学习(实例详解)

    本文摘自:http://blog.chinaunix.net/uid-20655530-id-1589483.html 学习 SIP 协议最快捷的方法是通过范例来学习, 找到了一个完整的呼叫流程,le ...

  4. action script 3如何检测播放器域

    检测播放器域   用户在上面观看媒体内容的网页的 URL 和域并非始终随时可用.如果托管网站允许,您可使用 ExternalInterface 类获取确切 URL.尽管如此,允许第三方视频播放器的一些 ...

  5. SVN和Git的比较

    最近开始学Git,跟以前常用的SVN来做个对比,以便对双方的优缺点了解更多些. 其实Git和SVN还是挺像的,都有提交,合并等操作,看来这是源码管理工具的基本操作. 1. Git是分布式的,SVN是集 ...

  6. iOS开发中(null)与<null>的判断

    判断(null): if(m_result==nil) {      NSLog(@"KDA!"); } 判断<null>: if([m_result isEqual: ...

  7. ASIHTTPRequest实现https双向认证请求

    什么是双向认证呢?简而言之,就是服务器端对请求它的客户端要进行身份验证,客户端对自己所请求的服务器也会做身份验证.服务端一旦验证到请求自己的客户端为不可信任的,服务端就拒绝继续通信.客户端如果发现服务 ...

  8. 异步刷新tableView

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [self.tableView rel ...

  9. SQLdiag-配置文件-PerfmonCollector

    前一篇我们已经使用默认配置文件收集了部分诊断数据,并且知道配置文件会影响收集数据的内容.这一篇我们重点讲述配置文件中与性能计数器相关的操作.可使用XML模板控制SQLdiag使用的收集器.每个收集器可 ...

  10. [GeoServer]Openlayers简单调用

    Openlayers Demo: <html> <head> <title>OpenLayers Example</title> <script ...