Linux Command To Find the System Configuration And Hardware Information..


1- How to Check System Serial Number ?


[root@server ~]# /usr/sbin/dmidecode | grep -e 'Manufacturer' -e 'Product Name' \ -e 'Serial Number' | head -n 3
or

[root@server ~]# dmidecode | grep -A 9 "System Information"

or

[root@server ~]# dmidecode | egrep -i "product name|serial number"

2- How To Check  system-product-name ?

[root@server ~]#  dmidecode -s system-product-name

3- How to Check Bios vendor ?

[root@server ~]# dmidecode -s  bios-vendor

4- How To Check Total HDD Size ?

[root@server ~]# fdisk -l | grep GB

5- How To Check Bios Information ?

[root@server ~]# dmidecode -t bios

6- How to check maximum RAM Supported by the system ?

[root@server ~]# dmidecode -t 16

Output:-
# dmidecode 2.12
SMBIOS 2.7 present.

Handle 0x0040, DMI type 16, 23 bytes
Physical Memory Array
    Location: System Board Or Motherboard
    Use: System Memory
    Error Correction Type: None
    Maximum Capacity: 16 GB
    Error Information Handle: Not Provided
    Number Of Devices: 2

7- How To Check RAM Speed ?

[root@server ~]# dmidecode --type 17 | grep -i speed

8- How To Check HDD Spead ?

[root@server ~]# hdparm -t /dev/sda
or
[root@server ~]# dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync

9- How To Check CPU Speed ?

[root@server ~]# dmesg | grep CPU

10- How To Check Last Installation Dtae ?

Centos-

[root@server ~]# rpm -qi centos-release

Output:-
Name        : centos-release               Relocations: (not relocatable)
Version     : 6                                 Vendor: CentOS
Release     : 5.el6.centos.11.2             Build Date: Sun 01 Dec 2013 05:36:14 AM IST
Install Date: Sun 15 Dec 2013 09:12:49 PM IST      Build Host: c6b9.bsys.dev.centos.org
Group       : System Environment/Base       Source RPM: centos-release-6-5.el6.centos.11.2.src.rpm
Size        : 33534                            License: GPLv2
Signature   : RSA/SHA1, Mon 02 Dec 2013 12:03:24 AM IST, Key ID 0946fca2c105b9de
Packager    : CentOS BuildSystem
Summary     : CentOS release file
Description :
CentOS release files

Redhat-

[root@server ~]# rpm -qi setup

Ubuntu-


[root@server ~]# ls -l --full-time /var/log/installer/syslog


Output-:

-rw------- 1 syslog adm 1272950 2013-05-01 16:20:12.000000000 +0530 /var/log/installer/syslog


11- How to check server 32 or 64 bit ?

[root@server ~]# getconf LONG_BIT

12- Find out information about the Linux distribution and version ?

[root@server ~]# lsb_release -a
or
[root@server ~]# cat /etc/*release*

13- How To Check List of All USB Device ?

[root@server ~]# lsusb

Output:
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 05c8:021e Cheng Uei Precision Industry Co., Ltd (Foxlink)
Bus 001 Device 007: ID 0cf3:3005 Atheros Communications, Inc. AR3011 Bluetooth
Bus 002 Device 003: ID 0781:5567 SanDisk Corp. Cruzer Blade
Let us try to understand above output in detail.
Bus 002 Device 003: ID 0781:5567 SanDisk Corp. Cruzer Blade
Bus 002 : This is bus number where SanDisk USB stick is attached.
Device 003: This is the third device attached to bus 002, the other two devices are "Linux Foundation 2.0 root hub" and " Intel Corp. Integrated Rate Matching Hub"
ID 0781:5567 is the number given to this SanDisk, The nember before : indicates the manufacture ID and number after : indicates device ID. To get more info on this visit

14- How To Display all the BUS information in a system.

[root@server ~]# lshw -businfo

15- How To Check RAM details such as how many slots, actual RAM present etc

[root@server ~]# dmidecode -t 17

Output:
# dmidecode 2.11
SMBIOS 2.7 present.
Handle 0×0010, DMI type 17, 34 bytes
Memory Device
Array Handle: 0x000F
Error Information Handle: 0×0011
Total Width: 64 bits
Data Width: 64 bits
Size: 4096 MB
Form Factor: SODIMM
Set: None
Locator: DIMM0
Bank Locator: BANK 0
Type: DDR3
Type Detail: Synchronous
Speed: 1333 MHz
Manufacturer: Kingston
Serial Number: 4B29A74B
Asset Tag: 0123456789
Part Number: 99U5428-046.A00LF
Rank: Unknown
Configured Clock Speed: 1333 MHz
Handle 0×0013, DMI type 17, 34 bytes
Memory Device
Array Handle: 0x000F
Error Information Handle: 0×0014
Total Width: 64 bits
Data Width: 64 bits
Size: 4096 MB
Form Factor: SODIMM
Set: None
Locator: DIMM1
Bank Locator: BANK 2
Type: DDR3
Type Detail: Synchronous
Speed: 1333 MHz
Manufacturer: Kingston
Serial Number: 4729BF4B
Asset Tag: 0123456789
Part Number: 99U5428-046.A00LF
Rank: Unknown
Configured Clock Speed: 1333 MHz

16- List all mass storage devices in your system.

[root@server ~]# lsusb -v | grep -Ei '(idVendor|Mass\ Storage)'

Output:

  idVendor           0x1d6b Linux Foundation
  idVendor           0x1d6b Linux Foundation
  idVendor           0x8087 Intel Corp.
  idVendor           0x8087 Intel Corp.
  idVendor           0x0c76 JMTek, LLC.
  idVendor           0x046d Logitech, Inc.
  idVendor           0x03f0 Hewlett-Packard
  bInterfaceClass         8 Mass Storage


17- Find USB devices protocol version.

[root@server ~]# lsusb -v | grep -i bcdusb

Output:

  bcdUSB               2.00
  bcdUSB               2.00
  bcdUSB               2.00
  bcdUSB               2.00
  bcdUSB               2.00
  bcdUSB               2.00
  bcdUSB               1.10
  bcdUSB               2.00
  bcdUSB               2.00
  bcdUSB               2.00

18- Find all your network cards(Ethernet, Gigabit Ethernet, Wireless) names attached to a given system.

[root@server ~]# ifconfig | cut -c1-8 | sort -u

Output:
eth0
lo  
virbr0

19- find how many network connections(network cables are connected to your machine) are active i.e. link is up.

[root@server ~]# ip link show


Output:

1: lo: mtu 16436 qdisc noqueue state UNKNOWN mode DEFAULT
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT qlen 1000
link/ether 10:1f:74:58:e1:04 brd ff:ff:ff:ff:ff:ff
3: wlan0: mtu 1500 qdisc mq state UP mode DORMANT qlen 1000
link/ether d0:df:9a:e6:1d:a6 brd ff:ff:ff:ff:ff:ff
4: virbr0: mtu 1500 qdisc noqueue state DOWN mode DEFAULT
link/ether 52:54:00:be:79:50 brd ff:ff:ff:ff:ff:ff
5: virbr0-nic: mtu 1500 qdisc pfifo_fast master virbr0 state DOWN mode DEFAULT qlen 500
link/ether 52:54:00:be:79:50 brd ff:ff:ff:ff:ff:ff


19- How can we find out network card speeds so that we can see throughput of the devices attached to a machine

[root@server ~]# ethtool eth0 | grep speed

output:
ethtool eth0 | grep Speed
Speed: 10Mb/s

20- How can we get MAC address of a given NIC card?

# ethtool -P devicename

Example:

# ethtool -P eth0

Output:
Permanent address: 10:1f:74:58:e1:04

21- How can we find network card manufacture details for both Ethernet card and wireless cards

[root@server ~]# lspci -v | grep -iE 'Wire|Ether'

Output:
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168 PCI Express Gigabit Ethernet controller (rev 06)
02:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)

22- How can we get NIC card mode details like full/half duplex

[root@server ~]# ethtool eth0 | grep Duplex

Output:
Duplex: Half

23- How about finding my network card is auto negotiation enabled or not in Linux?

[root@server ~]# ethtool eth0 | grep Auto

Output:
Auto-negotiation: on

24- Find number of sound cards present in your machine

[root@server ~]# cat /proc/asound/cards

Output:
0 [PCH ]: HDA-Intel – HDA Intel PCH
HDA Intel PCH at 0xc2600000 irq 45
If you see there is only one sound card which is HDA-Intel sound card which is an inbuilt one.
or
/proc/asound/cardX
Where X indicate no of cards, if you see card0, card1 then indicates you have two sound cards.
to see number of cards available

[root@server ~]# ls -ld /proc/asound/card* | grep ^d

Output:
dr-xr-xr-x 5 root root 0 Jun 9 12:08 /proc/asound/card0

25- Find number of sound cards present in your machine..

[root@server ~]# cat /proc/asound/cards

Output:
0 [PCH ]: HDA-Intel – HDA Intel PCH
HDA Intel PCH at 0xc2600000 irq 45
If you see there is only one sound card which is HDA-Intel sound card which is an inbuilt one.
or
/proc/asound/cardX
Where X indicate no of cards, if you see card0, card1 then indicates you have two sound cards.
to see number of cards available

[root@server ~]# ls -ld /proc/asound/card* | grep ^d

Output:

dr-xr-xr-x 5 root root 0 Jun 9 12:08 /proc/asound/card0

26- How to get card manufacture details using lspci command.

[root@server ~]# lspci -v | grep -i audio

Output:

00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)
or
[root@server ~]# alsamixer

27- How can I check how many number of devices attached to sound card like speakers, mic, woofers etc

[root@server ~]# cat /proc/asound/devices

Output:
1: : sequencer
2: [ 0- 3]: digital audio playback
3: [ 0- 0]: digital audio playback
4: [ 0- 0]: digital audio capture
5: [ 0- 3]: hardware dependent
6: [ 0- 0]: hardware dependent
7: [ 0] : control
33: : timer
From the above output we can see that there are two audio playback devices(Speakers) and an audio capture device(A mic) to this machine. And remaining details are sound card related information. Or we can use aplay command as well to get device details

[root@server ~]# aplay –list-devices

Output:

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC270 Analog [ALC270 Analog] Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0] Subdevices: 1/1
Subdevice #0: subdevice #0

28-  How can I get which Kernel module or sound driver details for my sound card. The module related to sound card is represented snd string in its name. So if we can search /proc/asound/modules file or lsmod command output we can easily find which sound card driver is in use as shown below


[root@server ~]# grep snd /proc/asound/modules

Output:
0 snd_hda_intel
or
[root@server ~]# lsmod | grep snd

Output:


snd_hda_codec_hdmi 32049 1
snd_hda_codec_realtek 78147 1
snd_hda_intel 33492 3
snd_hda_codec 134213 3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel
snd_hwdep 17699 1 snd_hda_codec
snd_pcm 96668 3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel
snd_seq_midi 13325 0
snd_rawmidi 30513 1 snd_seq_midi
snd_seq_midi_event 14900 1 snd_seq_midi
snd_seq 61555 2 snd_seq_midi_event,snd_seq_midi
snd_timer 29426 2 snd_pcm,snd_seq
snd_seq_device 14498 3 snd_seq,snd_rawmidi,snd_seq_midi
snd 78921 16 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec,snd_hda_intel,snd_seq_device
soundcore 15048 1 snd
snd_page_alloc 18485 2 snd_pcm,snd_hda_intel

29- How can I find sound card software version in Linux?

[root@server ~]# cat /proc/asound/version

Output:
Advanced Linux Sound Architecture Driver Version 1.0.25.

30- To find all the hardware attached to PCI slots in a given machine.

[root@server ~]# lspci

31- Not able to distungush different hardwares attached to the machine use -vmm option to display lspci command output.

[root@server ~]# lspci -vmm

Output:
Slot:    00:00.0
Class:    Host bridge
Vendor:    Intel Corporation
Device:    2nd Generation Core Processor Family DRAM Controller
SVendor:    Hewlett-Packard Company
SDevice:    Device 3672
Rev:    09

32- Display PCI slot information in tree format

[root@server ~]# lspci -t

Output:
-[0000:00]-+-00.0
           +-02.0
           +-16.0
           +-1a.0
           +-1b.0
           +-1c.0-[01]—-00.0
           +-1c.2-[02]—-00.0
           +-1c.4-[03-08]—-00.0
           +-1d.0
           +-1f.0
           +-1f.2
           \-1f.3

33- Display PCI devices atached their speeds, IRQ assigned Kernel drivers and modules etc.

[root@server ~]# lspci -v

34- How can I get number of optical device connected in my machine?

[root@server ~]# wodim –devices

Output:
wodim: Overview of accessible drives (1 found) :
————————————————————————-
0 dev='/dev/sg1' rwrw– : 'hp' 'DVD A DS8A5LH'
————————————————————————-
or

[root@server ~]# lsscsi

35- Check if your DVD/CD-ROM is mounted or not using below commands

[root@server ~]# df -h
or
[root@server ~]# cat /etc/mtab
 
36- Check CD/DVD-ROM can read and write different ROM's like reading DVD, writing DVD, reading CD and writing CD etc.

[root@server ~]# cat /proc/sys/dev/cdrom/info

37- Eject or open CD/DVD-ROM from drive

[root@server ~]# eject device-name

Example:

[root@server ~]# eject /dev/dvdrw3

38- Close CD/DVD-ROM once ROM is inserted

[root@server ~]# eject -t /dev/dvdrw3

39- Get full details like CD/DVD ROM manufacture, CD/DVD read and write speeds, CD/DVD rom type, CD/DVD rom hardware file name etc.

[root@server ~]# cdrecord -prcap
or
[root@server ~]#  wodim -prcap

40- How to check hard disk model and number under Linux

[root@server ~]# hdparm -I /dev/sda
[root@server ~]# hdparm -I /dev/sda | grep Serial

OR for IDE /dev/hda

[root@server ~]# hdparm -i /dev/hda
OR

[root@server ~]# hdparm -I /dev/hda

41- How To Display Hard Disk Partition Size

[root@server ~]# df

Sample outputs:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hdb1             19228276  14699744   3551784  81% /
tmpfs                   384300         4    384296   1% /dev/shm
/dev/hdb5             27917308  23883184   2615988  91% /data/network
42- How to Display Hard Disk Partition Size in Mega bytes or GB or TB

[root@server ~]# df -H

Sample outputs:
Filesystem             Size   Used  Avail Use% Mounted on
/dev/hdb1               20G    16G   3.7G  81% /
tmpfs                  394M   4.1k   394M   1% /dev/shm
/dev/hdb5               29G    25G   2.7G  91% /data/network

43- How to Display TOTAL Hard Disk Size

[root@server ~]# fdisk -l | grep Disk

Sample outputs:
Disk /dev/hda: 20.0 GB, 20060651520 bytes
Disk /dev/hdb: 80.0 GB, 80060424192 bytes

44- How To Check CPU ID..OR Model Number..

[root@server ~]# dmidecode –t 4 | grep ID

[root@server ~]# dmidecode -t 2

45- How To Check RAM Type..

[root@server ~]# dmidecode --type memory | grep -e DMI -e Form

46-Show the number of CPU cores

[root@server ~]# cat /proc/cpuinfo  | grep processor

processor    : 0
processor    : 1
processor    : 2
processor    : 3

Note- At first glance it appears that my laptop has 4 CPU cores in it.     However, it really has 2 CPU cores with hyperthreading enabled.  The hyperthreading presents 2 logical CPU's to the operating system for each actual core so it effectively doubles the number of logical CPU's your system will see in /proc/cpuinfo. 

The fields under /proc/cpuinfo that you need to compare to find the number of cores are "physical id" and "cored id".    The "physical id" will identifier for the physical CPU socket.   So to find the number of actual CPU sockets being used you can run this command:

[root@server ~]#  cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
1

In this example the computer only has 1 physical socket being used. 

47- How To show the total number of cores, you need to look at both "physical id" and "core id".   "core id" is the identifier for each core on a CPU socket.

[root@server ~]# cat /proc/cpuinfo | egrep "core id|physical id"

physical id    : 0
core id        : 0
physical id    : 0
core id        : 0
physical id    : 0
core id        : 2
physical id    : 0
core id        : 2

Put every 2 lines together (i.e. line 1 and 2, lines 3 and 4, lines 5 and 6, and lines 7 and 8) to see information about the 4 logical CPU's on the system.    If you compare lines 1 and 2 to lines 3 and 4 you will see that they are identical.   This is because lines 1-4 are actually a single CPU core that are presented as 2 logical CPU's due to hyperthreading.   So based on this output we can see there are 2 unique CPU cores (lines 1-4 and lines 5-8).

Using the following command we can tie all of this together to show the number of cores on a system:

[root@server ~]# cat /proc/cpuinfo | egrep "core id|physical id" | tr -d "\n" | sed s/physical/\\nphysical/g | grep -v ^$ | sort | uniq | wc -l
2

This command squishes the /proc/cpuinfo physical id and core id for each logical CPU on to the same line, and then sorts them and runs uniq to remove the extra hyperthreading logical CPU's.   The final result is the number of CPU cores on your Linux system. 

As previously mentioned you can also run this command to see the number of physical CPU sockets in use:

[root@server ~]#  cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
1

So in our example here we have a single CPU socket and 2 CPU cores.   

Or

[root@server ~]# cat /proc/cpuinfo | grep "^processor" | wc -l
2

48- How to check my intel processor is 3rd generation or 2nd generation?

Ans-

If the processor number is 2000 something, it's 2nd gen.

If it's 3000 something, it's 3rd gen

49- How do I find out the model of my graphics card?

[root@server ~]# lshw -C video

50- How to determine whether a given Linux is 32 bit or 64 bit?

[root@server ~]# getconf LONG_BIT

or

[root@server ~]#  uname -m





I Hope You Like It..So Enjoy..

______________________________________________________________________________________
Click Back..                                Click Home..
https://docs.google.com/forms/d/1iNRZlJJO6rBFizzPcFmyOTEtfkdjhdVRmpM74IbiT3o/viewform