uname
Overview
The uname
command prints system information including kernel name, network node hostname, kernel release, version, machine hardware name, and operating system.
Syntax
uname [options]
Common Options
Option | Description |
---|---|
-a |
Print all information |
-s |
Print kernel name |
-n |
Print network node hostname |
-r |
Print kernel release |
-v |
Print kernel version |
-m |
Print machine hardware name |
-p |
Print processor type |
-i |
Print hardware platform |
-o |
Print operating system |
Key Use Cases
- System identification
- OS version checking
- Architecture detection
- Kernel information
- Platform verification
Examples with Explanations
Example 1: All Information
uname -a
Display all system information
Example 2: Kernel Version
uname -r
Show kernel release version
Example 3: Machine Hardware
uname -m
Display machine hardware name
Understanding Output
Example output format:
Linux hostname 5.4.0-generic #1-Ubuntu x86_64 GNU/Linux
Components: - Kernel name - Host name - Kernel release - Kernel version - Machine architecture - Operating system
Common Usage Patterns
Check system type:
uname -s
Get architecture:
uname -m
Full system info:
uname -a
Performance Analysis
- Fast execution
- Minimal system impact
- Static information
- No file system access
- Lightweight operation
Additional Resources
Use Cases
- Script system detection
- Compatibility checking
- System documentation
- Build environment setup
- Platform verification
Best Practices
- Use -a for complete info
- Check specific components
- Combine with other commands
- Script automation
- Regular monitoring