Getting System Information

February 8, 2026

Here are three commands to get the number of processors, amount of memory, and disk information for a given server.

# Number of CPU Threads
nproc
8

# Total physical memory
echo $(echo "$(awk '/MemTotal/ {print $2}' /proc/meminfo) / 1000 / 1000" | bc) GiB
32 GiB

# Disk drives, size, and serial numbers
lshw -class disk | grep "disk\|size:\|/dev/sd\|serial"
  *-disk:0
       logical name: /dev/sda
       serial: 172617A9DBC2
       size: 223GiB (240GB)
  *-disk:1
       logical name: /dev/sdb
       serial: 174719CB8F35
       size: 223GiB (240GB)