查看Linux伺服器各種資訊方法

來源:互聯網
上載者:User
       有的時候需要搜集伺服器的各種資訊,比如cpu資訊,記憶體資訊,linux版本資訊,安裝的各種軟體資訊等等。下面總結幾種主要指標的查看方法。1. 查看Linux發行版資訊[root@pcmweb ~]# cat /etc/issue
Red Hat Enterprise Linux Server release 5 (Tikanga)
Kernel   on an m2.查看Linux核心資訊[root@pcmweb ~]# uname -r
2.6.18-8.el5xen3.查看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

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.