Linux List Hardware Information Command

by on November 5, 2007 · 20 comments· LAST UPDATED August 25, 2013

in , ,

How do I get detailed hardware information about my Linux server using command line options? What is the Linux command to find out hardware information?
You can use any one of the following tool to extract detailed information on the hardware configuration of the machine:

  1. dmidecode command - See a description of the system's hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision.
  2. Tutorial details
    DifficultyIntermediate (rss)
    Root privilegesYes
    Requirementslshw/dmidecode
    Estimated completion time10m
  3. lshw command - list hardware command.
  4. ls* commands.
  5. /proc/ file system

Method #1 dmidecode tool

Use yum or apt-get command to install dmidecode tool. Once installed, type the following command to list hardware information:
# dmidecode
Sample outputs:

SMBIOS 2.6 present.
18 structures occupying 992 bytes.
Table at 0x0009B400.
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
        Vendor: American Megatrends Inc.
        Version: 080016
        Release Date: 04/01/2010
        Address: 0xF0000
        Runtime Size: 64 kB
        ROM Size: 1024 kB
        Characteristics:
                ISA is supported
                PCI is supported
                PNP is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                ESCD support is available
                Boot from CD is supported
                Selectable boot is supported
                BIOS ROM is socketed
                EDD is supported
                5.25"/1.2 MB floppy services are supported (int 13h)
                3.5"/720 kB floppy services are supported (int 13h)
                3.5"/2.88 MB floppy services are supported (int 13h)
                Print screen service is supported (int 5h)
                8042 keyboard services are supported (int 9h)
                Serial services are supported (int 14h)
                Printer services are supported (int 17h)
                CGA/mono video services are supported (int 10h)
                ACPI is supported
                USB legacy is supported
                LS-120 boot is supported
                ATAPI Zip drive boot is supported
                BIOS boot specification is supported
                Targeted content distribution is supported
        BIOS Revision: 8.16
Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: ICP / iEi
        Product Name: TS-859 PRO
        Version: V1.0
        Serial Number: To Be Filled By O.E.M.

See our article "Get Information About Your BIOS / Server Hardware From a Shell Without Opening Chassis" for more information.

Method #2: lshw too

This tool an report exact memory configuration, firmware version, main board configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines. It currently supports DMI (x86 and IA-64 only), OpenFirmware device tree (PowerPC only), PCI/AGP, CPUID (x86), IDE/ATA/ATAPI, PCMCIA (only tested on x86), SCSI and USB.

NOTE: Install lshw either using 'apt-get install lshw' (Debian and Friends) or 'yum instal lshw' (Red Hat and Friends). YMMV.

List hardware

Type the lshw at a shell prompt:
# lshw | more
OR
# lshw
Sample outputs:

nas01
    description: Computer
    product: TS-859 PRO (To Be Filled By O.E.M.)
    vendor: ICP / iEi
    version: V1.0
    serial: To Be Filled By O.E.M.
    width: 64 bits
    capabilities: smbios-2.6 dmi-2.6 vsyscall32
    configuration: boot=normal family=To Be Filled By O.E.M. sku=To Be Filled By O.E.M. uuid=00020003-0004-0005-0006-000700080009
  *-core
       description: Motherboard
       product: TS-859 PRO(Q904)
       vendor: ICP / iEi
       physical id: 0
       version: V1.0
       serial: To be filled by O.E.M.
       slot: To Be Filled By O.E.M.
     *-firmware
          description: BIOS
          vendor: American Megatrends Inc.
          physical id: 0
          version: 080016
          date: 04/01/2010
          size: 64KiB
          capacity: 960KiB

To lists hardware in a compact format, type:
# lshw -short
Sample outputs:

H/W path             Device     Class      Description
======================================================
                                system     TS-859 PRO (To Be Filled By O.E.M.)
/0                              bus        TS-859 PRO(Q904)
/0/0                            memory     64KiB BIOS
/0/3                            processor  Intel(R) Atom(TM) CPU D510   @ 1.66GHz
/0/3/4                          memory     48KiB L1 cache
/0/3/5                          memory     1MiB L2 cache
/0/8                            memory     2GiB System Memory
/0/8/0                          memory     2GiB DIMM DDR2 Synchronous 667 MHz (1.5 ns)
/0/8/1                          memory     DIMM [empty]
/0/100                          bridge     Atom Processor D4xx/D5xx/N4xx/N5xx DMI Bridge
/0/100/2                        display    Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller
/0/100/2.1                      display    Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller
/0/100/1a                       bus        82801I (ICH9 Family) USB UHCI Controller #4
/0/100/1a.1                     bus        82801I (ICH9 Family) USB UHCI Controller #5
/0/100/1a.2                     bus        82801I (ICH9 Family) USB UHCI Controller #6
/0/100/1a.7                     bus        82801I (ICH9 Family) USB2 EHCI Controller #2
/0/100/1c                       bridge     82801I (ICH9 Family) PCI Express Port 1
/0/100/1c.1                     bridge     82801I (ICH9 Family) PCI Express Port 2
/0/100/1c.1/0        eth0       network    82574L Gigabit Network Connection
/0/100/1c.2                     bridge     82801I (ICH9 Family) PCI Express Port 3
/0/100/1c.2/0        eth1       network    82574L Gigabit Network Connection
/0/100/1c.5                     bridge     82801I (ICH9 Family) PCI Express Port 6
/0/100/1c.5/0                   storage    JMB363 SATA/IDE Controller
/0/100/1c.5/0.1                 storage    JMB363 SATA/IDE Controller
/0/100/1d                       bus        82801I (ICH9 Family) USB UHCI Controller #1
/0/100/1d.1                     bus        82801I (ICH9 Family) USB UHCI Controller #2
/0/100/1d.2                     bus        82801I (ICH9 Family) USB UHCI Controller #3
/0/100/1d.7                     bus        82801I (ICH9 Family) USB2 EHCI Controller #1
/0/100/1e                       bridge     82801 PCI Bridge
/0/100/1f                       bridge     82801IR (ICH9R) LPC Interface Controller
/0/100/1f.2          scsi1      storage    82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]
/0/100/1f.2/0        /dev/sda   disk       2TB ST32000641AS
/0/100/1f.2/0/1      /dev/sda1  volume     40GiB Linux raid autodetect partition
/0/100/1f.2/0/2      /dev/sda2  volume     509MiB Linux raid autodetect partition
/0/100/1f.2/0/3      /dev/sda3  volume     500GiB Linux raid autodetect partition
/0/100/1f.2/0/4      /dev/sda4  volume     200GiB Linux raid autodetect partition
/0/100/1f.2/1        /dev/sdb   disk       2TB ST32000641AS
/0/100/1f.2/1/1      /dev/sdb1  volume     40GiB Linux raid autodetect partition
/0/100/1f.2/1/2      /dev/sdb2  volume     509MiB Linux raid autodetect partition
/0/100/1f.2/1/3      /dev/sdb3  volume     500GiB Linux raid autodetect partition
/0/100/1f.2/1/4      /dev/sdb4  volume     200GiB Linux raid autodetect partition
/0/100/1f.2/2        /dev/sdc   disk       2TB ST32000641AS
/0/100/1f.2/2/1      /dev/sdc1  volume     40GiB Linux raid autodetect partition
/0/100/1f.2/2/2      /dev/sdc2  volume     509MiB Linux raid autodetect partition
/0/100/1f.2/2/3      /dev/sdc3  volume     500GiB Linux raid autodetect partition
/0/100/1f.2/2/4      /dev/sdc4  volume     200GiB Linux raid autodetect partition
/0/100/1f.2/3        /dev/sdd   disk       2TB ST2000DM001-1CH1
/0/100/1f.2/3/1      /dev/sdd1  volume     40GiB Linux raid autodetect partition
/0/100/1f.2/3/2      /dev/sdd2  volume     509MiB Linux raid autodetect partition
/0/100/1f.2/3/3      /dev/sdd3  volume     500GiB Linux raid autodetect partition
/0/100/1f.2/3/4      /dev/sdd4  volume     200GiB Linux raid autodetect partition
/0/100/1f.2/0.0.0    /dev/sde   disk       2TB ST32000641AS
/0/100/1f.2/0.0.0/1  /dev/sde1  volume     40GiB Linux raid autodetect partition
/0/100/1f.2/0.0.0/2  /dev/sde2  volume     509MiB Linux raid autodetect partition
/0/100/1f.2/0.0.0/3  /dev/sde3  volume     500GiB Linux raid autodetect partition
/0/100/1f.2/0.0.0/4  /dev/sde4  volume     200GiB Linux raid autodetect partition
/0/100/1f.3                     bus        82801I (ICH9 Family) SMBus Controller
/0/1                 scsi10     storage
/0/1/0.0.0           /dev/sdf   disk       515MB SCSI Disk
/0/1/0.0.0/1         /dev/sdf1  volume     491MiB EXT3 volume

To lists all disks and storage controllers in the system, type:
# lshw -class disk -class storage
To lists all network interfaces in HTML format, enter:
# lshw -html -class network

ls* Commands

Use the lspci command list all PCI devices on Linux based systems:
# lspci
Use the lscpu command to display information on CPU architecture using Linux based systems:
# lscpu
Use the lsusb command to display information on USB devices using Linux based systems:
# lsusb
Use lsscsi command to list SCSI devices (or hosts) and their attributes on Linux:
# lsscsi
Use lsb_release and uname commands to list your distro and kernel version:
# lsb_release -a
# uname -a

Recommend readings
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 20 comments… read them below or add one }

1 miljan November 9, 2007 at 7:47 am

Similar result can be produced with command ‘dmidecode’. But the output is not so nicely formated as with lshw. :)

Reply

2 Anil November 10, 2007 at 2:39 pm

Is this same as lshal .. I am using that and I couldn’t find lshw

Anil

Reply

3 Gagan December 20, 2007 at 7:58 am

lshw is a different command I believe. You need to have the dag repositories installed on the server to have this pre-enabled. If not then you can get the lshw command installed. You can get that at the following link:-

http://dag.wieers.com/packages/lshw/

Reply

4 kunal singh September 29, 2008 at 7:45 am

dear sir/madam
i am using linux 5.0 ent.and connect external SCSI DLT tap drive. its show in bios but how can mount it to use for backup and recovery.

another server is configered by 16 gb of RAM, its also show in bios but in linux 5.0 ent. its show only 4 gb. what its problem and how can i solve it.

Reply

5 ~S~ December 1, 2008 at 9:26 pm

@kunal singh

If you are running 32bit, you will have to have “bigmem” enabled (possibly with the PAE extension?) in the kernel. I don’t know if CentOS provides this kernel or not. If not, you will have to roll your own.

If you are running 64bit, then it should detect all 16GB of memory. If it isn’t then you have a much bigger problem.

As for the SCSI tape drive, afraid I don’t have an answer without knowing a lot more about your setup. Maybe someone else will.

If you are indeed running CentOS try posting to the CentOS forum/mailing list.

Have fun!
~S~

Reply

6 solarmitra January 12, 2009 at 8:37 pm

I have used these command on centos/RHEL

lspci ( lists pci device)
lsusb ( lists usb device)
lsscsi ( lists scsi device)
systool
fdisk -l ( lists hard drive)
dmidecode ( lists hardware model, serial number, cpu, memory. This command was handy when i needed to find serial number without a visit to data center)
cat /proc/cpuinfo ( more on cpu)
cat /proc/meminfo ( more on memory)

you can find a lot of information by using dmesg|more or grep what you are looking
e.g.
dmesg | egrep ‘(SCSI|scsi0|ide0|hda|sda|serio|mice|eth0|eth1)’

Reply

7 zubair January 15, 2009 at 8:23 am

hello everybody
this is zubair from vijayawada
anybody please tell me what is the command to see linux system configuration

Reply

8 ani August 8, 2009 at 8:01 am

try using lspci

Reply

9 bhavani sankaram September 15, 2009 at 10:49 am

Hi Techies,

I have one requirement to capture the connected printers information from esx servers (either 2.0 or 3.0) using linux commads.

I used “lpstat” command to capture the printer information from esx servers which are in linux environment. Please help me to get this info.

Reply

10 bhavani sankaram September 15, 2009 at 10:54 am

continued (1)
using lpstat command i am not able to capture the printer information which are connected to esx servers.

Please suggest me the way to reach my requirement

Reply

11 manoj jasawat September 25, 2009 at 5:11 am

how to install —-
lan driver rtl8169 in rhel5

Reply

12 raj November 17, 2009 at 2:00 pm

How to get the hardware configuration in linux (debian )

Reply

13 Sajeevan K June 18, 2010 at 6:37 am

try dmidecode commands it gives all h/w information

Reply

14 pritesh August 24, 2011 at 9:24 am

is there any inbuilt fucntions in c programming language which return information like processor name ,speed and operating system name….?

Reply

15 Nino December 21, 2011 at 9:09 pm

second to Sajeevan K. then “pipe it to more: | more” since you will get a lot of info and depending on your putty session buffer you won’t be able to scroll all the way up.

Reply

16 Sathishkumar April 5, 2012 at 7:12 am

Its really worthful information. I thankful and appreciate all the commenters because Everyone wrote some useful comments in their comment

Thanks
Sathish

Reply

17 Tarique Muhiuddin August 23, 2012 at 7:14 am

Try using lspci |more

or try to use for update through internet using command

update-pciids

This command will update your hardware.

Regards.
Tarique Muhiuddin
Linux Specialist

Reply

18 Abhijit Das January 9, 2013 at 2:41 am

Need a sample script to get the below informations in Linux.

 Hardware
 Server name
 Virtual/Physical
 # of CPU
 # of Core
 Physical server name in case of virtual server
 DTAP
 Is DR applicable
 Is it part of Cluster
 Software
 Vendor name
 Software name
 Software version
 Software edition
 Service pack
 ISO 19770 tag or other when available

Reply

19 kevin hayes August 25, 2013 at 1:10 pm

Hi
I would like help to get my sd card reader to work in mint 14. My machine is HP Pavilion dv6 – 2113sa. When i put a card in i cannot access it but it works fine in windows 7.

Swaitchblade145

Reply

20 Marcin October 3, 2013 at 11:08 am

I use hwinfo.

Reply

Leave a Comment

Tagged as: , , , , ,

Previous Faq:

Next Faq: