Command lineeasyBash

System Information Commands

Commands to check system hardware, OS version, and resource information.

01

The problem

You need to check system specifications, OS version, or hardware details.

02

The solution

Bash
# Kernel and OS info
uname -a
cat /etc/os-release
lsb_release -a

# CPU information
lscpu
cat /proc/cpuinfo
nproc                    # Number of CPU cores

# Memory information
free -h
cat /proc/meminfo
vmstat -s

# Disk information
lsblk
fdisk -l
blkid

# Hardware details
lshw                    # Requires sudo
dmidecode               # Detailed hardware info

# PCI/USB devices
lspci
lsusb
lsusb -v

# System uptime
uptime
who -b                  # Last boot

# Load average
cat /proc/loadavg
w                       # Shows load and users

# Environment variables
env
printenv
echo $PATH

# Shell info
echo $SHELL
echo $0

# User info
whoami
id
groups

# System date/time
date
timedatectl
hwclock

# Network hostname
hostname
hostnamectl

# Kernel modules
lsmod
modinfo module_name

# Systemd version
systemctl --version

# Check service status
systemctl status service_name

# Battery info (laptops)
upower -i /org/freedesktop/UPower/devices/battery_BAT0
acpi -V

03

Put it to work

Example
# Quick system overview
echo "OS: $(cat /etc/os-release | grep PRETTY_NAME)"
echo "Kernel: $(uname -r)"
echo "CPU: $(nproc) cores"
echo "Memory: $(free -h | awk '/^Mem:/ {print $2}')"
echo "Uptime: $(uptime -p)"

# Check disk space
df -h | grep -v tmpfs

# Hardware summary
sudo lshw -short

# Monitor real-time resources
watch -n 1 'free -h; echo; uptime; echo; df -h /'

Worth knowing

Many commands require root for full details. Use /proc filesystem for kernel info. lshw provides comprehensive hardware tree.