Which is the command to get info about Linux system? If you wish to display system hardware information or get system specs of your Linux system, you can use the following commands.
System Hardware Information Commands In Linux
You will need to have information about your system to install appropriate software and drivers or install the desired Kernel modules or even to apply patches. To make things easiers, this article lists out 5 commands that provide details about your system’s architecture, hardware and OS.
1. lscpu – Display CPU information
The lscpu command can be used to display information about the CPU architecture. The command lscpu gathers CPU architecture information from sysfs 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, CPU caches and cache sharing, family, model, bogoMIPS, byte order, and stepping.
Some of the useful CPU info shows by the lscpu command are:
- CPU: The logical CPU number of a CPU as used by the Linux kernel.
- CORE: The logical core number. A core can contain several CPUs.
- SOCKET: The logical socket number. A socket can contain several cores.
- CACHE: Information about how caches are shared between CPUs.
- NODE: The logical NUMA node number. A node may contain several books.
- ADDRESS The physical address of a CPU.
NOTE: Not all columns are supported on all architectures. If an unsupported column is specified, lscpu prints the column but does not provide any data for it.
2. df, fdisk – Display disk information
The df command is used to display file system disk space usage. In simple words, df reports the amount of disk space used and available on file systems.
Normally the disk space is printed in units of 1024 bytes, but this can be overridden using the -h command option/argument.
The ‘-h’ or ‘–human-readable’ command option appends a size letter to each size, such as ‘M’ for mebibytes. Note that powers of 1024 are used, not 1000; ‘M’ stands for 1,048,576 bytes. This option is equivalent to ‘–block-size=human-readable’. You can use ‘-k’ command option to print sizes in 1024-byte blocks, overriding the default block size.
fdisk is another command to display or manipulate a disk partition table. You can use -l or –list command option to display partitions end exit. Use -u to display units: ‘cylinders’ or ‘sectors’ (default) and -s to display device size in 512-byte sectors.
3. lsusb – Show USB information
The lsusb command can be used to display information about USB buses in the system and the devices connected to them. Use the lsusb command with -v or –verbose command option to display detailed information about the usb devices.
This includes configuration descriptors for the device’s current speed. Class descriptors will be shown, when available, for USB device classes including hub, audio, HID, communications, and chipcard.
4. free – Show RAM or Memory information
Linux users can use free command to display amount of free and used memory in the system. When executed the free command displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches used by the kernel.
The free command displays the following set of info:
- total: Total installed memory (MemTotal and SwapTotal in /proc/meminfo)
- used: Used memory (calculated as total – free – buffers – cache)
- free: Unused memory (MemFree and SwapFree in /proc/meminfo)
- buffers: Memory used by kernel buffers (Buffers in /proc/meminfo)
- cache Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo)
- available: Estimation of how much memory is available for starting new applications, without swapping.
5. dmidecode – Get System Info
You can use the demicode command to get system info such as Processor, RAM(DIMMs), BIOS detail, Memory, Serial numbers etc. The demicode is the command for Desktop Management Interface (DMI) table which retrieves data from DMI table and produce it in human readable format.
It is used to retrieve system’s hardware related information such as system’s BIOS vendor, version, release date, and revision, as well as details about the system’s manufacturer, product name, serial number, UUID, SKU number, family, baseboard information, chassis details, processor family, manufacturer, version, and frequency.
Simply run the following command to gets system info:
dmidecode -t system
Similarly, to get BIOS information, run:
dmidecode -t bios
That’s all. I’ve listed some helpful commands to get the system and hardware info including the Linux operating system info.