Many times we want to find out more details about a machine. This can be because we’ve run into an issue and need to know more about what’s causing it. Or because we’re simply curious.

Whatever the reason, this page is for you.

Info

All commands are run using a normal user, unless specified.

Operating System

Knowing what operating system is running is the first step.

lsb_release -a
cat /etc/*-release
# Not applicable for rolling distros

This will show something like (Fedora/Redhat will be shorter):

Distributor ID:	Debian
Description:	Debian GNU/Linux 9 (stretch)
Release:	9
Codename:	stretch

Filesystem locks

lslocks
# and/or
lsof

List namespaces

lsns

Get Kernel version

uname -r

uname screenshot

Built in items

Show all the details

We’ll start off first with a tool that can show most if not all of the hardware details. You’ll likely need to install this, and running it as root can show more. I’ve shown the full path, as this may be needed to run it as a user.

/usr/sbin/hwinfo --short

The rest of the tools are all built-in.

CPU details

These two tools provide details about the CPU.

lscpu

lspci screenshot

cat /proc/cpuinfo

lspci screenshot

Memory

List the memory.

lsmem

IPC

While IPC is older, it’s still used in some systems

lsipc

lsipc screenshot

Attached items

List hardware that’s connected.

PCI cards attached

lspci

lspci screenshot

USB Drives

lsusb

lsusb screenshot

Disk layout

Getting the layout of your drives is easy.

lsblk

Will show something like:

NAME                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda                             8:0    0 249.5G  0 disk  
├─sda1                          8:17   0   500M  0 part  /boot
└─sda2                          8:18   0   249G  0 part  
  └─luks_main                 254:0    0   249G  0 crypt 
    ├─vg_main-data            254:1    0   237G  0 lvm   /
    └─vg_main-lv_cryptswap    254:2    0    12G  0 lvm   
      └─cryptswap             254:3    0    12G  0 crypt [SWAP]
sr0                            11:0    1  1024M  0 rom 

Conclusion

There are many useful tools to get details about your system and it’s hardware.