Skip to Content
This project is a work in progress. If you have any questions or suggestions, feel free to contact me.

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

PurposeCommandDescription
OS Versioncat /etc/redhat-releaseShows the OS version
Kernel Infouname -r or hostnamectlDisplays kernel version
Hostnamehostname, hostnamectlShows the system hostname
CPU InfolscpuDisplays CPU architecture information
Memory Infofree -h, /proc/meminfoShows memory usage information
Disk Infolsblk, df -hShows disk usage information
Boot Messages`dmesgless`
System UptimeuptimeShows system uptime
Hardware Detailssudo dmidecode, lshwShows detailed hardware information
Last updated on