未加星标

Commands to check hardware Information In Linux

字体大小 | |
[系统(linux) 所属分类 系统(linux) | 发布者 店小二03 | 时间 2017 | 作者 红领巾 ] 0人收藏点击收藏

We have lot of commands in linux but some give more details what we expect, here are the few which gives too depth detail about hardware information on linux. Each command we can use different scenario. This all contains details about hardware components like CPU, memory and more.

lscpu

lscpugathers CPU architecture information from sizes and /proc/cpuinfo. The command output can be optimized for parsing or for easy readability by humans. The information

includes, for example, the number of CPUs, threads, cores, sockets, and Non-Uniform Memory Access (NUMA) nodes. There is also information about the CPU caches and cache sharing, family, model, bogoMIPS, byte order, and stepping.

# lscpu
Commands to check hardware Information In Linux
2.lshw List Hardware

lshwis a small tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines (PowerMac G4 is known to work).

It currently supports DMI (x86 and IA-64 only), Open Firmware device tree (PowerPC only), PCI/AGP, CPUID (x86), IDE/ATA/ATAPI, PCMCIA (only tested on x86), SCSI and USB.

# lshw -short

hwinfo Hardware Information

Hwinfo is another general purpose hardware probing utility that can report detailed and brief information about multiple different hardware components, and more than what lshw can report.

# hwinfo short

lspci List PCI

The lspci command lists out all the pci buses and details about the devices connected to them.

The vga adapter, graphics card, network adapter, usb ports, sata controllers, etc all fall under this category.

# lspci

Filter out specific device information with grep.

# lspci -v | grep “VGA” -A 12

lsscsi List scsi devices

Lists out the scsi/sata devices like hard drives and optical drives.

# lsscsi

[3:0:0:0] disk ATA ST3500418AS CC38 /dev/sda [4:0:0:0] cd/dvd SONY DVD RW DRU-190A 1.63 /dev/sr0 lsusb List usb buses and device details

This command shows the USB controllers and details about devices connected to them. By default brief information is printed. Use the verbose option “-v” to print detailed information about each usb port

# lsusb

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 005 Device 002: ID 045e:00cb Microsoft Corp. Basic Optical Mouse v2.0

On the above system, 1 usb port is being used by the mouse.

lsblk List block devices

List out information all block devices, which are the hard drive partitions and other storage devices like optical drives and flash drives

# lsblk


Commands to check hardware Information In Linux
df disk space of file systems

Reports various partitions, their mount points and the used and available space on each.

# df -H


Commands to check hardware Information In Linux
Pydf python df

An improved df version written in python, that displays colored output that looks better than df

# pydf


Commands to check hardware Information In Linux
fdisk

Fdisk is a utility to modify partitions on hard drives, and can be used to list out the partition information as well.

# fdisk -l


Commands to check hardware Information In Linux
mount

The mount is used to mount/unmount and view mounted file systems.

# mount | column t


Commands to check hardware Information In Linux

Again, use grep to filter out only those file systems that you want to see

# mount | column -t | grep ext

free Check RAM

Check the amount of used, free and total amount of RAM on system with the free command.

# free -m

total used free shared buffers cached

Mem: 1861 850 1010 0 136 476

-/+ buffers/cache: 237 1623

Swap: 2047 1 2046

dmidecode

The dmidecode command is different from all other commands. It extracts hardware information by reading data from the SMBOIS data structures (also called DMI tables).

to display information about the processor/cpu

# dmidecode -t processor

to check memory/ram information

# dmidecode -t memory

to check bios details

# dmidecode -t bios

Check out the man page for more details.

/proc files

Many of the virtual files in the /proc directory contain information about hardware and configurations. Here are some of them

CPU/Memory information

to get cpu information

# cat /proc/cpuinfo

to get memory information

# cat /proc/meminfo

Linux/kernel information

# cat /proc/version

Linux version 2.6.32-642.3.1.el6.x86_64 (mockbuild@worker1.bsys.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) ) #1 SMP Tue Jul 12 18:30:56 UTC 2016

SCSI/Sata devices

# cat /proc/scsi/scsi

Attached devices:

Host: scsi1 Channel: 00 Id: 00 Lun: 00

Vendor: NECVMWar Model: VMware IDE CDR10 Rev: 1.00

Type: CD-ROM ANSI SCSI revision: 05

Host: scsi2 Channel: 00 Id: 00 Lun: 00

Vendor: VMware Model: Virtual disk Rev: 1.0

Type: Direct-Access ANSI SCSI revision: 02

Partitions

# cat /proc/partitions

major minor #blocks name

8 0 52428800 sda

8 1 1024 sda1

8 2 1048576 sda2

8 3 9434112 sda3

8 4 41943040 sda4

253 0 49274880 dm-0

253 1 2097152 dm-1

hdparm

hdparmprovides a command line interface to various kernel interfaces supported by the Linux SATA/PATA/SAS “libata” subsystem and the older IDE driver subsystem. Many newer (2008 and later) USB drive enclosures now also support “SAT” (SCSI-ATA Command Translation) and therefore may also work with hdparm. Some options may work correctly only with the latest kernels.

# hdparm -i /dev/sda

/dev/sda:

Model=ST3500418AS, FwRev=CC38, SerialNo=9VMJXV1N

Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }

RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4

BuffType=unknown, BuffSize=16384kB, MaxMultSect=16, MultSect=16

CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=976773168

IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}

PIO modes: pio0 pio1 pio2 pio3 pio4

DMA modes: mdma0

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

主题: LinuxCPUCSICHSUTUTCPythonSAS
tags: information,about,devices,hardware,proc,details,command,out
分页:12
转载请注明
本文标题:Commands to check hardware Information In Linux
本站链接:http://www.codesec.net/view/523031.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(88)