Linux Commands To Collect System and Hardware Information
Getting information about system and hardware is important part of System Administration job. There are a lot of different tools those provides information about system and hardware. In this post we will look how to get CPU, memory, disk, bus, usb, disk … information simple from a Linux system.
Print Operating System
Linux system administrators generally work different type of Operating systems which are similar to Linux. To get detailed operation system information like Unix, BSD etc.
uname command can be used.
Print Host name
Host name is used for system to identify and name them. Printing host name can be done in different ways.
$ uname -n
Computer architecture is generally related with CPU running on the system. There are different type of CPU’s used in server hardware like x86, Arm, PowerPC, etc.
$ uname -m
In this situation our system is x86 and 64 bit operating system.
Print Kernel Information
Kernel is the core of an operating system. There are different kernel used in Unix like operating systems. Other than Linux, Bsd, Solaris are alternative kernels.
$ uname -r
List All Hardware
To get fast and furious way about the all hardware
lshw command can be used. This command requires root privileges to probe in detail.
$ sudo lshw
List Hardware As Table
Previous output may be seem a bit untidy. Alternative is sorting the output of
$ sudo lshw -short
List Hardware To Html
While working with command line interface bash and related tools are useful. But if we want to get information in HTML form
lshw provides html web page output for the list of hardware.
$ sudo lshw -html > systeminformation.html
Print Memory Information
Print CPU Information
CPU related information is important. The performance and capabilities can be get from CPU information. CPU’s, core, CPU family, CPU cache, threads, supported instruction sets, hypervisor vendor, virtualization type CPU frequency and speed information can be get with the following command.
Print Block Device/Disk Information
Installed disks can be get with
lsblk command. lsblk command will provide information about name , major, minor numbers size, read write status, type and mount point of currently installed disk devices.
Print USB Information
USB provides flexible way to connect devices to the computers. To list USB controllers and connected devices to a Linux system following command can be used. Also USB devices manufacturer and memory address ranges can be learned with this command.
Print PCI Information
PCI is the main way to connect different type high data rate devices like graphics cards, network adapters, USB ports etc. PCI bus connected devices can be listed with
From this output we can see that Intel USB controllers are connected to the PCI. QXL graphic controller and Virtio Ethernet controller is also connected from this PCI bus.
Print Detailed PCI Information
By using previous
lspci command with the
-v parameter more detailed information about the PCI devices can be get like below.
$ lspci -v
Print SCSI Information
SCSI is another popular BUS used to connect different type of devices to the Linux systems. SCSI interface devices are pricier than PCI because they are generally used in enterprise server hardware. SCSI information similar to the PCI can be listed with the following command.
Print SATA/Disk Information
Disk device information can be get with the
hdparm command like below.
$ sudo hdparm /dev/sda
Print File System Information
File system information can be gathered by using
fdisk command. Although
fdisk can be used for creating partitions, file systems and other disk related media also provides file system information with the
$ sudo fdisk -l
Print BIOS Information
Bios is the first operating system when the computer starts. It is very basic operating system which provides base line for real operating systems like Linux. BIOS provide wealth information about the hardware and itself. These information can be get with the following command.
$ sudo dmidecode -t bios
Print Chassis Information
Chassis is the main board and related part of a system. Enterprise server hardware manufacturers put details into its chassis like serial number, model etc. These information can be get with the following command.
$ sudo dmidecode -t system