Getting to Know Your Machine
When troubleshooting or performing administration, knowing basic system details is essential.
The uname Command
uname prints system information. Run alone, it usually displays the kernel name (Linux).
| Option | Output | Example |
|---|---|---|
-s | Kernel name | Linux |
-n | Network node hostname | ubuntu-vm |
-r | Kernel release version | 5.15.0-86-generic |
-v | Kernel version string | #96~22.04.1-Ubuntu SMP ... |
-m | Hardware architecture | x86_64 |
-a | All information (most common) | (Combination of all) |
bash $ uname -a Linux ubuntu-vm 5.15.0-86-generic #96~22.04.1-Ubuntu SMP ... x86_64 x86_64 x86_64 GNU/Linux
The hostname Command
hostname displays or sets the system's hostname.
bash $ hostname ubuntu-vm
To see the distribution release version, you often check the contents of a file:
bash $ cat /etc/os-release