|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
安装和登录命令:login、shutdown、halt、reboot、mount、umount、chsh
在Linux体系中,有很多命令可用于查询主机的硬件信息。一些命令只针对特定的硬件组件,好比CPU、内存,一些命令能够查询多个硬件信息。
这篇文章只是复杂的让每一个人懂得查询硬件信息的基础命令利用,包含lscpu、hwinfo、lshw、lspci、lsblk、lsusb等等。
1.lscpu用于查询CPU信息
- [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工具,然后就能够利用了。- wgethttp://ezix.org/software/files/lshw-B.02.14.tar.gztar-zxvflshw-B.02.14.tar.gzcdlshw-B.02.14make&&makeinstall
复制代码 示例:- [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- #rpm-Uvhhttp://mirror.symnds.com/distributions/gf/el/6/gf/x86_64/gf-release-6-6.gf.el6.noarch.rpm#yumlisthwinfo#yuminstallhwinfo
复制代码 CentOS5- #rpm-Uvhhttp://mirror.symnds.com/distributions/gf/el/5/gf/x86_64/gf-release-5-6.gf.el5.noarch.rpm#yumlisthwinfo#yuminstallhwinfo
复制代码- [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
复制代码- [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.....
复制代码 示例:- [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包利用上面的命令:- [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!
复制代码 示例:- 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包的一部分,以是你必要依照以下命令安装:- wgethttp://ezix.org/software/files/lshw-B.02.14.tar.gztar-zxvflshw-B.02.14.tar.gzcdlshw-B.02.14make&&makeinstall1
复制代码- wgethttp://ezix.org/software/files/lshw-B.02.14.tar.gztar-zxvflshw-B.02.14.tar.gzcdlshw-B.02.14make&&makeinstall2
复制代码 示例:- wgethttp://ezix.org/software/files/lshw-B.02.14.tar.gztar-zxvflshw-B.02.14.tar.gzcdlshw-B.02.14make&&makeinstall3
复制代码 6.lsblk-列出块设备的信息
- 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设备的信息,好比硬盘驱动器、光盘驱动器。- 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类系统上就肯定有. |
|