仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 554|回复: 8
打印 上一主题 下一主题

[其他Linux] Linux教程之反省和搜集 Linux 硬件信息的 7 个命令

[复制链接]
萌萌妈妈 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-15 22:13:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
安装和登录命令:login、shutdown、halt、reboot、mount、umount、chsh
  在Linux体系中,有很多命令可用于查询主机的硬件信息。一些命令只针对特定的硬件组件,好比CPU、内存,一些命令能够查询多个硬件信息。
  这篇文章只是复杂的让每一个人懂得查询硬件信息的基础命令利用,包含lscpu、hwinfo、lshw、lspci、lsblk、lsusb等等。



  1.lscpu用于查询CPU信息
  1. [root@devops~]#lscpuArchitecture:x86_64CPUop-mode(s):32-bit,64-bitByteOrder:LittleEndianCPU(s):1On-lineCPU(s)list:0Thread(s)percore:1Core(s)persocket:1CPUsocket(s):1NUMAnode(s):1VendorID:GenuineIntelCPUfamily:6Model:45Stepping:7CPUMHz:2194.842BogoMIPS:4389.68Hypervisorvendor:XenVirtualizationtype:fullL1dcache:32KL1icache:32KL2cache:256KL3cache:15360KNUMAnode0CPU(s):0
复制代码
  2.lshw显现硬件信息表

  这个命令使用广泛,它可经由过程团体需求而列出多种分歧的硬件参数:CPU、内存、硬盘、USB把持器、lshw卡片等等,实质上就是从/proc目次分歧文件中中提取对应的硬件信息。
  依照上面的步骤往安装lshw工具,然后就能够利用了。
  1. wgethttp://ezix.org/software/files/lshw-B.02.14.tar.gztar-zxvflshw-B.02.14.tar.gzcdlshw-B.02.14make&&makeinstall
复制代码
  示例:
  1. [root@devopslshw-B.02.14]#lshw-shortH/WpathDeviceClassDescription=====================================================systemHVMdomU/0busMotherboard/0/0memory96KiBBIOS/0/1processorIntel(R)Xeon(R)CPUE5-24300@2.20GHz/0/2memorySystemMemory/0/2/0memory512MiBDIMMRAM/0/2/1memory512MiBDIMMRAM/0/3memory96KiBBIOS/0/4processorCPU/0/5memorySystemMemory/0/6memory/0/7memory/0/100bridge440FX-82441FXPMC[Natoma]/0/100/1bridge82371SBPIIX3ISA[Natoma/TritonII]/0/100/1.1scsi1storage82371SBPIIX3IDE[Natoma/TritonII]/0/100/1.1/0.0.0/dev/cdrom1diskSCSICD-ROM/0/100/1.2bus82371SBPIIX3USB[Natoma/TritonII]/0/100/1.2/1usb1busUHCIHostController/0/100/1.2/1/2inputQEMUUSBTablet/0/100/1.3bridge82371AB/EB/MBPIIX4ACPI/0/100/2displayGD5446/0/100/3genericXenPlatformDevice/1eth0networkEthernetinterface/2eth1networkEthernetinterface[root@devopslshw-B.02.14]#
复制代码
  3.hwinfo-硬件信息

  hwinfo相似于lshw,也能查询硬件信息,且使用普遍。它也能输入多个硬件部分的具体大概扼要信息,可是分歧的是偶然hwinfo比lshw的信息更具体。
  默许情形下,Linux体系没有安装hwinfo工具,以是你必要依照以下步骤本人安装:
  CentOS6
  1. #rpm-Uvhhttp://mirror.symnds.com/distributions/gf/el/6/gf/x86_64/gf-release-6-6.gf.el6.noarch.rpm#yumlisthwinfo#yuminstallhwinfo
复制代码
  CentOS5
  1. #rpm-Uvhhttp://mirror.symnds.com/distributions/gf/el/5/gf/x86_64/gf-release-5-6.gf.el5.noarch.rpm#yumlisthwinfo#yuminstallhwinfo
复制代码
  1. [root@devopstmp]#rpm-Uvhhttp://mirror.symnds.com/distributions/gf/el/6/gf/x86_64/gf-release-6-6.gf.el6.noarch.rpmRetrievinghttp://mirror.symnds.com/distributions/gf/el/6/gf/x86_64/gf-release-6-6.gf.el6.noarch.rpmwarning:/var/tmp/rpm-tmp.m2mMAO:HeaderV4RSA/SHA1Signature,keyID13a4d2a9:NOKEYPreparing...###########################################[100%]1:gf-release###########################################[100%][root@devopstmp]#yumlisthwinfoLoadedplugins:fastestmirrorLoadingmirrorspeedsfromcachedhostfile*base:mirrors.aliyun.com*extras:mirrors.aliyun.com*updates:mirrors.aliyun.comgf00:00gf/primary_db00:00AvailablePackageshwinfo.x86_64[root@devopstmp]#yumlisthwinfoLoadedplugins:fastestmirrorLoadingmirrorspeedsfromcachedhostfile*base:mirrors.aliyun.com*extras:mirrors.aliyun.com*updates:mirrors.aliyun.comgf00:00gf/primary_db00:00AvailablePackageshwinfo.x86_6420.2-1.gf.el6
复制代码
  1. [root@devopstmp]#yuminstallhwinfoLoadedplugins:fastestmirrorLoadingmirrorspeedsfromcachedhostfile*base:mirrors.aliyun.com*extras:mirrors.aliyun.com*updates:mirrors.aliyun.comSettingupInstallProcessResolvingDependencies-->Runningtransactioncheck--->Packagehwinfo.x86_640:20.2-1.gf.el6willbeinstalled.....
复制代码
  示例:
  1. [root@devopstmp]#hwinfo-shortoops:dontknowwhattodowith"short"[root@devopstmp]#hwinfo--shortcpu:Intel(R)Xeon(R)CPUE5-24300@2.20GHz,2194MHzkeyboard:/dev/input/event3ATTranslatedSet2keyboard/dev/ttyS0serialconsolemouse:/dev/input/miceAdomaxQEMUUSBTablet/dev/input/miceMacintoshmousebuttonemulation/dev/input/miceImExPS/2GenericExplorerMousegraphicscard:CirrusLogicGD5446storage:Intel82371SBPIIX3IDE[Natoma/TritonII]XenVirtualStorage0XenVirtualStorage1XenVirtualStorage2network:eth0XenVirtualEthernetCard0eth1XenVirtualEthernetCard1networkinterface:loLoopbacknetworkinterfaceeth0Ethernetnetworkinterfaceeth1Ethernetnetworkinterfacedisk:/dev/xvdaDisk/dev/xvdbDiskpartition:/dev/xvda1Partition/dev/xvdb1Partitioncdrom:/dev/sr0QEMUDVD-ROMusbcontroller:QumranetQemuvirtualmachinebios:BIOSbridge:QumranetQemuvirtualmachineQumranetQemuvirtualmachineQumranetQemuvirtualmachinehub:Linux2.6.32-279.el6.x86_64uhci_hcdUHCIHostControllermemory:MainMemoryunknown:FPUDMAcontrollerPICTimerKeyboardcontrollerXenSourceXenPlatformDevice[root@devopstmp]#
复制代码
  4.lspci

  lsppci命令可列出PCI总线的信息和毗连到PCI总线上的设备信息,好比VGA适配器、SATA把持器、其他模块等等。lspci工具是pciutils包的一部分,以是在安装lspci之前,你必要安装pciutils包。
  安装pciutils包利用上面的命令:
  1. #yuminstallpciutils
复制代码
  1. [root@devopstmp]#yuminstallpciutilsLoadedplugins:fastestmirrorLoadingmirrorspeedsfromcachedhostfile*base:mirrors.aliyun.com*extras:mirrors.aliyun.com*updates:mirrors.aliyun.comSettingupInstallProcessResolvingDependencies-->Runningtransactioncheck--->Packagepciutils.x86_640:3.1.10-2.el6willbeinstalled-->ProcessingDependency:pciutils-libs=3.1.10-2.el6forpackage:pciutils-3.1.10-2.el6.x86_64-->Runningtransactioncheck--->Packagepciutils-libs.x86_640:3.1.4-11.el6willbeupdated--->Packagepciutils-libs.x86_640:3.1.10-2.el6willbeanupdate-->FinishedDependencyResolutionDependenciesResolvedInstalling:pciutilsx86_643.1.10-2.el685kUpdatingfordependencies:pciutils-libsx86_643.1.10-2.el634k.....DependencyUpdated:pciutils-libs.x86_640:3.1.10-2.el6Complete!
复制代码
  示例:
  1. wgethttp://ezix.org/software/files/lshw-B.02.14.tar.gztar-zxvflshw-B.02.14.tar.gzcdlshw-B.02.14make&&makeinstall0
复制代码
  5.lsusb-列出USB总线信息

  这个命令可列出USB把持器的设备信息。
  lsusb工具是usbutils包的一部分,以是你必要依照以下命令安装:
  1. wgethttp://ezix.org/software/files/lshw-B.02.14.tar.gztar-zxvflshw-B.02.14.tar.gzcdlshw-B.02.14make&&makeinstall1
复制代码
  1. wgethttp://ezix.org/software/files/lshw-B.02.14.tar.gztar-zxvflshw-B.02.14.tar.gzcdlshw-B.02.14make&&makeinstall2
复制代码
  示例:
  1. wgethttp://ezix.org/software/files/lshw-B.02.14.tar.gztar-zxvflshw-B.02.14.tar.gzcdlshw-B.02.14make&&makeinstall3
复制代码
  6.lsblk-列出块设备的信息
  1. wgethttp://ezix.org/software/files/lshw-B.02.14.tar.gztar-zxvflshw-B.02.14.tar.gzcdlshw-B.02.14make&&makeinstall4
复制代码
  7.lsscsi-列出SCSI的设备信息

  列出SCSI/SDAT设备的信息,好比硬盘驱动器、光盘驱动器。
  1. wgethttp://ezix.org/software/files/lshw-B.02.14.tar.gztar-zxvflshw-B.02.14.tar.gzcdlshw-B.02.14make&&makeinstall5
复制代码
  终了!Enjoythis!
  原文地点:http://www.itsprite.com/linux-7-linux-commands-to-checkgather-hardware-information-in-linux-system/
看不懂man文档的人.在linux中,命令可分为系统基本命令和应用程序命令.系统基本命令是所有的unix类系统都支持的命令,走到哪都不变,只要是unix类系统上就肯定有.
灵魂腐蚀 该用户已被删除
沙发
发表于 2015-1-17 17:10:26 | 只看该作者
请问谁有Linux的学习心得的吗?简单的说说?
再见西城 该用户已被删除
板凳
发表于 2015-1-17 17:10:26 | 只看该作者
有疑问前,知识学习前,先用搜索。
小女巫 该用户已被删除
地板
发表于 2015-1-22 06:35:13 | 只看该作者
把这个问题放在其他Linux社区请求帮助也是一种选择。如果Linux得不到答案,请不要以为我们觉得无法帮助你。有时只是看到你问题的人不知道答案罢了。这时换一个社区是不错的选择。
分手快乐 该用户已被删除
5#
发表于 2015-1-30 23:33:26 | 只看该作者
学习Linux应具备的。[书籍+网络资源]
深爱那片海 该用户已被删除
6#
发表于 2015-2-6 17:16:36 | 只看该作者
当然你不需搭建所有服务,可以慢慢来。自己多动手,不要非等着别人帮你解决问题。
7#
发表于 2015-2-17 19:47:39 | 只看该作者
Linux高手更具有鼓励新手的文化精神。如何在Linux社区获得帮助,需要说明的是你要有周全的思考,准备好你的问题,不要草率的发问。
柔情似水 该用户已被删除
8#
发表于 2015-3-5 22:57:03 | 只看该作者
直到学习Linux这门课以后,我才知道,原来我错了。?
因胸联盟 该用户已被删除
9#
发表于 2015-3-20 00:41:42 | 只看该作者
在学习的过程中,我们用的是VM虚拟机,开始时真的不真的该怎么去做,特别是我的是命令窗口界面,别人的是图形界面,我都不知道怎么调过来。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-18 11:07

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表