玩Linux笔记(4) —— Shell下查看硬件和系统信息

下午的时候本本无线网卡出了些故障,需要查看网卡信息,本人目前用的是ubuntu 12.10 桌面版,图形界面比较人性化,一点都不技术,于是找了半天没找到在哪查看硬件信息。于是就跑到命令行下面去,但是平时在shell下的工作主要是分析Log啊、启服务停服务啊啥的,与硬件相关的命令用的不多,想了半天也想不起如何查看无线网卡信息,于是就各种找资料,在Linux shell下查看各种硬件信息的方法。

1. 使用lspci

使用lspci命令可以查看链接到PCI总线上的设备,常见的PCI总线设备比如显卡、声卡、网卡,如图所示,露一下家底:

samchi@ubuntu:~$ lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)
00:1c.2 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 3 (rev b4)
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b4)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM65 Express Chipset Family LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)
01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Whistler [AMD Radeon HD 6600M Series]
07:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8188CE 802.11b/g/n WiFi Adapter (rev 01)
0c:00.0 System peripheral: JMicron Technology Corp. SD/MMC Host Controller (rev 30)
0c:00.2 SD Host controller: JMicron Technology Corp. Standard SD Host Controller (rev 30)
11:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)
可以看到我的无线网卡是Realtek的,嗯嗯。

另外通过使用lscpi -v 可以看到更加详细的硬件信息:

2. 通过访问/proc文件系统来查看设备信息

/proc文件系统是Linux中一个比较特殊的文件系统,关于它的详细介绍可以参考这篇文章:http://my.oschina.net/chihz/blog/84431

通过查看/proc文件系统可以查看CPU、内存、挂载以及可用设备的信息。

查看CPU信息: cat /proc/cpuinfo

查看内存信息: cat /proc/meminfo

……

3. 查看操作系统版本信息

查看操作系统信息分为两部分,一个是查看内核的版本信息,另一个是查看Linux发行版本信息。

查看内核可以通过使用 uname命令来完成:

samchi@ubuntu:/boot/grub$ uname -r
3.5.0-19-generic
查看Linux发行版本的信息可以通过查看/etc/issue文件来获取:

samchi@ubuntu:/boot/grub$ cat /etc/issue
Ubuntu 12.10 \n \l

你可能感兴趣的:(玩Linux笔记(4) —— Shell下查看硬件和系统信息)