How to Check Ubuntu Server Hardware Specifications via SSH: CPU, RAM and Disk Info Commands


2 views

When remotely managing an Ubuntu server via SSH, these commands provide comprehensive hardware information:

# Basic system overview
sudo lshw -short

# CPU details
lscpu
cat /proc/cpuinfo

# Memory information
free -h
cat /proc/meminfo

# Disk space and partitions
lsblk
df -h

For more thorough hardware inspection on headless servers:

# Install hardware detection utilities
sudo apt install hwinfo inxi -y

# Comprehensive hardware report
sudo hwinfo --short

# Condensed system summary
inxi -Fxz

Targeted commands for particular components:

# GPU information (if present)
lspci | grep -i vga

# Network interfaces
lshw -class network

# USB devices
lsusb -v

# Temperature sensors (requires lm-sensors)
sudo apt install lm-sensors
sudo sensors-detect
sensors

For documentation or monitoring purposes:

# Save full hardware info to file
sudo lshw -html > hardware_report.html

# Generate JSON output for parsing
sudo lshw -json

Remember that some commands like lshw and dmidecode require root privileges. Always use sudo when necessary and follow your organization's security policies when gathering system information.


When remotely managing an Ubuntu server via SSH, these commands provide comprehensive hardware details:

# Display memory information
sudo lshw -short -C memory

# Show CPU details including cores and speed
lscpu

# Alternative CPU information
cat /proc/cpuinfo

For a complete hardware overview, use these powerful commands:

# Comprehensive hardware report (requires lshw)
sudo lshw -html > hardware_report.html

# Quick system summary
sudo dmidecode -t system

# NVMe/SSD health check (if applicable)
sudo nvme list
sudo smartctl -a /dev/nvme0n1
# GPU information (for servers with graphics)
lspci | grep -i vga

# Disk partitioning and usage
lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINT

# Network interface details
ip addr show

For system administrators needing regular hardware audits:

#!/bin/bash
# Generate timestamped hardware report
REPORT_FILE="/var/log/hardware_$(date +%Y%m%d).log"
{
    echo "=== CPU Information ==="
    lscpu
    echo "\n=== Memory Details ==="
    free -h
    echo "\n=== Disk Configuration ==="
    lsblk
    echo "\n=== PCI Devices ==="
    lspci
} > $REPORT_FILE

Consider these additional packages for deeper analysis:

# Install hardinfo for GUI-like reports
sudo apt install hardinfo

# Generate HTML report with hardinfo
hardinfo -r hardware_report.html