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:
hostnamectlExample 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-64Just 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 combinedHostname Information
hostname # Short hostname
hostname -f # Fully Qualified Domain Name (FQDN)
hostnamectl # Includes hostname + OS info + architectureHardware and CPU Info
lscpuShows detailed CPU architecture including cores, threads, model, and vendor.
lsblkLists block devices (disks, partitions).
lshw # Not installed by default, install via: sudo dnf install lshwdmidecode # Needs sudo, shows BIOS, motherboard, and memory info
sudo dmidecode | lessMemory Information
free -hShows memory and swap usage in human-readable form.
cat /proc/meminfoDetailed memory information.
System Uptime
uptimeShows 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 timeSystem Logs and Boot Messages
dmesg | lessPrints kernel ring buffer messages (hardware, drivers, boot info).
Use dmesg | grep to filter:
dmesg | grep memory
dmesg | grep -i usbSystem Information Summary
uname -a
hostnamectl
lsb_release -a # Shows distribution info (not installed by default)
cat /etc/redhat-release # Preferred way for RHELOptional Installations (if not found by default on minimal RHEL 9):
sudo dnf install lshw lsb_release dmidecode net-toolsCommon 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