Operating System and Kernel Information
In Linux, you can gather detailed information about the operating system and kernel using various commands. Here are some of the most useful commands:
Get detailed system and kernel info:
hostnamectl
Example output:
Static hostname: rhel9-server
Icon name: computer-vm
Chassis: vm
Machine ID: abcdef123456...
Boot ID: 123456abcdef...
Operating System: Red Hat Enterprise Linux 9.2 (Plow)
CPE OS Name: cpe:/o:redhat:enterprise_linux:9::baseos
Kernel: Linux 5.14.0-284.el9.x86_64
Architecture: x86-64
Just kernel name, release, version:
uname -s # Kernel name
uname -r # Kernel release
uname -v # Kernel version
uname -m # Machine hardware name
uname -a # All of the above combined
Hostname Information
hostname # Short hostname
hostname -f # Fully Qualified Domain Name (FQDN)
hostnamectl # Includes hostname + OS info + architecture
Hardware and CPU Info
lscpu
Shows detailed CPU architecture including cores, threads, model, and vendor.
lsblk
Lists block devices (disks, partitions).
lshw # Not installed by default, install via: sudo dnf install lshw
dmidecode # Needs sudo, shows BIOS, motherboard, and memory info
sudo dmidecode | less
Memory Information
free -h
Shows memory and swap usage in human-readable form.
cat /proc/meminfo
Detailed memory information.
System Uptime
uptime
Shows how long the system has been running, current time, number of users, and load average.
uptime -p # Pretty uptime (e.g., "up 2 hours, 5 minutes")
uptime -s # Shows system boot time
System Logs and Boot Messages
dmesg | less
Prints kernel ring buffer messages (hardware, drivers, boot info).
Use dmesg | grep
to filter:
dmesg | grep memory
dmesg | grep -i usb
System Information Summary
uname -a
hostnamectl
lsb_release -a # Shows distribution info (not installed by default)
cat /etc/redhat-release # Preferred way for RHEL
Optional Installations (if not found by default on minimal RHEL 9):
sudo dnf install lshw lsb_release dmidecode net-tools
Common Use Case Summary
Purpose | Command | Description |
---|---|---|
OS Version | cat /etc/redhat-release | Shows the OS version |
Kernel Info | uname -r or hostnamectl | Displays kernel version |
Hostname | hostname , hostnamectl | Shows the system hostname |
CPU Info | lscpu | Displays CPU architecture information |
Memory Info | free -h , /proc/meminfo | Shows memory usage information |
Disk Info | lsblk , df -h | Shows disk usage information |
Boot Messages | `dmesg | less` |
System Uptime | uptime | Shows system uptime |
Hardware Details | sudo dmidecode , lshw | Shows detailed hardware information |
Last updated on