您的位置:首页 > 运维架构 > Linux

Linux——查看系统硬件信息

2012-07-06 09:16 381 查看
前言:下面实验的信息是我在几台配置不同服务器的测试结果,操作系统分别为Red Hat Enterprise Linux Server release 6.0 (Santiago)、Ubuntu 7.10。所以你看到我实验信息的不同时,请不要大惊小怪。而且有些命令也不是所有Linux操作系统都支持(例如在Ubuntu 7.10就不支持dmesg),下面的内容是收集整理的,如有错误或新的方法,也会不停整理、更新。

一:查看CPU信息

1、CPU详细信息

方法1:CPU信息一般保存在proc目录下的cpuinfo文件中。如下所示。

View Code
你也可以用free命令查看

View Code
查看内存条型号

View Code
三:查看磁盘信息

View Code

View Code
View Code
View Code
View Code
四:查看网卡信息

1. mii-tool 指令来查看网卡信息。它主要是用于配置网卡工作模式的指令,同时也可以用于查询、监控工作。

2. 直接输入dmesg可以看到开机检测到硬件信息

3. ethtool eth0 采用此命令查到网卡相关的技术指标 (不一定所有网卡支持都支持此命令)

4. more /etc/sysconfig/network-scripts/ifcfg-eth0 用这个可以看到网卡的信息

5. ifconfig

6. lspci

网卡配置文件

每一个网络介质都对应一个配置文件,超级用户可以通过这些配置文件来配置网卡

网卡配置文件存放在/etc/sysconfig/network-scripts/目录中

/etc/sysconfig/network-scripts/ifcfg-interface-name

设置文件ifcfg-interface-name包含了初始化接口所需的大部分周详信息,其中interface-name将根据网卡的类型和排序而不同,一般其名字为eth0、eth1、ppp0等,

其中eth表示以太(eth0)类型网卡,0表示第一块网卡、1表示第二块网卡,而ppp0则表示point-to-poirt protocol网络接口。在ifcfg文件中定义的各项目取决于接口类型。

DEVICE=name 其中name是物理设备名

IPADDR=addr 其中addr是IP地址

NETMASK=mask 其中mask是网络掩码值

NETWORK=addr 其中addr是网络地址

BROADCAST=addr 其中addr是广播地址

GATEWAY=addr 其中addr是网关地址

ONBOOT=answer 其中answer是yes(引导时激活设备)或no(引导时不激活设备)

USECTL=answer 其中answer是yes(非root用户能控制该设备)或no

BOOTPROTO=proto

[root@DB-Server ~]# ethtool eth0

Settings for eth0:

Supported ports: [ TP ]

Supported link modes: 10baseT/Half 10baseT/Full

100baseT/Half 100baseT/Full

1000baseT/Full

Supports auto-negotiation: Yes

Advertised link modes: 10baseT/Half 10baseT/Full

100baseT/Half 100baseT/Full

1000baseT/Full

Advertised pause frame use: No

Advertised auto-negotiation: Yes

Speed: 100Mb/s

Duplex: Full

Port: Twisted Pair

PHYAD: 0

Transceiver: internal

Auto-negotiation: on

MDI-X: Unknown

Supports Wake-on: pg

Wake-on: d

Current message level: 0x00000001 (1)

Link detected: yes

ethtool -i eth0 加上-i查看网卡驱动

[root@DB-Server ~]# ethtool -i eth0

driver: ATL1C

version: 1.0.1.14

firmware-version: L1e

bus-info: 0000:02:00.0

[root@DB-Server ~]# dmesg | grep eth0

atheros_eth 0000:02:00.0: ATL1C: eth0 NIC Link is Up<100 Mbps Full Duplex>

[root@DB-Server ~]# more /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

IPADDR=172.20.32.97

NETMASK=255.255.248.0

GATEWAY=172.20.39.251

DNS1=172.20.0.11

ONBOOT=yes

HWADDR=50:e5:49:df:b0:8b

BOOTPROTO=none

TYPE=Ethernet

IPV6INIT=no

USERCTL=no

[root@DB-Server ~]# mii-tool

eth0: negotiated 100baseTx-FD, link ok

五:查看主板信息

View Code
六:查看显卡信息

[root@DB-Server ~]# lspci |grep VGA

01:05.0 VGA compatible controller: ATI Technologies Inc 760G [Radeon 3000]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: