How to Check System Information in Linux (uname)
uname prints information about the current system, including the kernel name, version, and machine architecture.
Published October 2, 2026
uname prints system information: kernel name, release, machine architecture and more. uname -a shows everything on one line.
How it works
Common flags: -s kernel name, -r kernel release, -m architecture, -n hostname. For distribution details read /etc/os-release or run lsb_release -a.
Useful in scripts to branch by OS or architecture.
Try it
uname -a
Linux web1 6.8.0-45-generic #45 SMP x86_64 GNU/Linux
cat /etc/os-release | head -2
Practical examples
Kernel and arch
uname -sr
uname -mDistribution
cat /etc/os-releaseCPU and memory
lscpu | head
free -hScript branching
if [ "$(uname)" = "Darwin" ]; then echo mac; fiCommon mistakes
- Assuming uname reports the distribution.
- Confusing kernel version with OS version.
- Hard-coding architecture checks without arm64 cases.
Key takeaways
- uname -a = system summary.
- /etc/os-release = distro.
- Check arch in scripts.
FAQ
x86_64 vs aarch64?
Intel/AMD 64-bit vs ARM 64-bit.
hostnamectl?
Shows hostname, OS and kernel on systemd systems.