有的时候需要搜集服务器的各种信息,比如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. (转)常用的js设计模式

    模式是解决或者避免一些问题的方案. 在JavaScript中,会用到一些常用的编码模式.下面就列出了一些常用的JavaScript编码模式,有的模式是为了解决特定的问题,有的则是帮助我们避免一些Jav ...

  2. Bootstrap 表格和按钮

    一.表格 1.条纹状表格 行产生一行隔一行加单色背景效果 注:表格效果需要基于基本格式.table <table class="table table-striped"> ...

  3. Cloudera Hadoop什么是CDH及CDH版本介绍

    本文引用自:Cloudera Hadoop什么是CDH及CDH版本介绍http://www.aboutyun.com/thread-6788-1-1.html(出处: about云开发) 云技术新兴的 ...

  4. 點擊按鈕后彈出新頁面導致原頁面CSS失效

    比方说在页面里面有个LinkButton,要点击以后要打开新窗口,而且新窗口的URL是根据用户选择结果动态产生的.LinkButton的代码这样写:    protected void Service ...

  5. Top 10 Free Wireless Network hacking/monitoring tools for ethical hackers and businesses

    There are lots of free tools available online to get easy access to the WiFi networks intended to he ...

  6. 常用 linux 命令(部分)

    常用命令总结: 1. mkdir命令 mkdir dirname , 用来创建目录.该命令创建由dirname命名的目录.如果在目录名的前面没有加任何路径名,则在当前目录下创建由dirname指定的目 ...

  7. LeetCode Word Break II

    原题链接在这里:https://leetcode.com/problems/word-break-ii/ 题目: Given a string s and a dictionary of words  ...

  8. css3背景色渐变

    <style> .test { width: 200px; height: 200px; background: -moz-linear-gradient(top, #8fa1ff, #3 ...

  9. tomcat启动出现PermGen space错误

    今天部署项目时,出现了jvm内存溢出的问题,显示PermGen  space错误. 经过不断的努力,终于解决出来了. 步骤如下: 在eclipse中菜单栏run-->RunConfigurati ...

  10. Eclipse/Myeclipse 开发项目技巧

    Eclipse/Myeclipse 开发项目 编程的本质: 把现实生活中的业务逻辑用代码实现. eclipse 是一个开放源代码.基于Java的可扩展开发平台. (最初主要用来Java语言开发,但目前 ...