Useful Linux Terminal Commands

Hardware inventory, RAM diagnostics, disks, services and networking

Technical Reference

Memory and CPU

TopicProcedure / notes
sudo dmidecode --type 17 | grep -E "Type:|Speed:|Manufacturer:"DMI memory module type, reported speed and vendor; firmware data may be incomplete or inaccurate.
sudo lshw -short -C memoryList memory devices; install lshw if missing.
inxi -C -mSummarize CPU and memory; install inxi if missing.
free -hUsed, available and cached memory.
lscpuCPU architecture, cores, threads and flags.

Storage and system

TopicProcedure / notes
lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINTS,MODELList block devices and mounted filesystems.
df -hFilesystem usage.
sudo smartctl -a /dev/nvme0Inspect NVMe SMART details; confirm actual device first and install smartmontools.
sudo journalctl -p warning -bWarnings/errors from current boot.
systemctl --failedList failed systemd units.

Networking and performance

TopicProcedure / notes
ip -br addrBrief interface and address list.
ip routeRouting table.
ss -tulpnListening TCP/UDP sockets and owning processes where permitted.
ping -c 4 1.1.1.1Basic connectivity check.
topLive process and CPU/memory view.
sudo dmesg --level=err,warnKernel warnings and errors; access varies by distribution.

Service note: Model, firmware version and region can change key combinations and hardware options. Verify the exact device service manual and back up important data before repairs.

Diagnostic Tools