Uname Command
The command ‘uname‘ displays the information about the system
This command is used to display the information such as
kernel name,hostname , kernel release date , kernel version , operating system , hardware platform ( bit of CPU , it is based on CPU instruction set ) , machine hardware ( this is the number of bit or architecture of motherboard or data bus support )
1. -a option: It prints all the system information in the following order: Kernel name, network node hostname, kernel release date, kernel version, machine hardware name, hardware platform, operating system
eg : uname -a
2. -s option: It prints the kernel name.
eg : uname -s
3. -n option: It prints the hostname of the network node(current computer).
eg : uname -n
4. -r option: It prints the kernel release date.
eg : uname -r
5. -v option: It prints the version of the current kernel.
eg : uname -v
6. -m option: It prints the machine hardware name.
eg uname -m
7. -p option: It prints the type of the processor.
eg uname -p
8. -i option: It prints the platform of the hardware.
eg uname -i
9. -o option: It prints the name of the operating system.
eg : uname -o
If you want to get the information of the operating system . then cat the following file
cat /etc/os-release
output:
- NAME="Ubuntu"
- VERSION="18.04.3 LTS (Bionic Beaver)"
- ID=ubuntu
- ID_LIKE=debian
- PRETTY_NAME="Ubuntu 18.04.3 LTS"
- VERSION_ID="18.04"
- HOME_URL="https://www.ubuntu.com/"
- SUPPORT_URL="https://help.ubuntu.com/"
- BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
- PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
- VERSION_CODENAME=bionic
- UBUNTU_CODENAME=bionic