Linux Commands — uname with examples
uname command
Uname is the major command to check the system information. This command can be used with many options.
Syntax:
Uname options
Example-1:
Checking the architecture of the system or machine:
Using the “-m” option with uname command we can figure out the system architecture.
Command execution and sample output is given below,
[root@sys1 ~]# uname -m
x86_64
Here, we have shown the command execution from root user but it can also be executed from the normal user.
Note:
There is another command also to display the system architecture.
[root@sys1 ~]# arch
x86_64
Example-2:
Checking the type of Operating system:
Using “uname –s command” we will display the name of the OS.
[root@sys1 ~]# uname -s
Linux
Example-3:
Checking the kernel release of the system:
Get abclearn’s stories in your inbox
Join Medium for free to get updates from this writer.
Using uname –r command we will check the release of the os.
[root@sys1 ~]# uname -r
2.6.32-358.el6.x86_64
Example-4:
Checking the system hostname information:
Using “uname –n” command we will check the hostname of the system.
[root@sys1 ~]# uname -n
sys1.abclearn.com
Example-5:
Listing out all of the system information at once:
Uname –a is the command to check all the information of the system.
[root@sys1 ~]# uname -a
Linux sys1.abclearn.com 2.6.32-358.el6.x86_64 #1 SMP Tue Jun 29 11:47:41 EST 2016 x86_64 x86_64 x86_64 GNU/Linux
“uname” is the command with “-a” option is used to display kernel and processor information of the system.
From the above output:
Linux (first column) à represents the operating system
Sys1.ithonours.com(second column) à represents the hostname given.
3.10.0-12 3.el7.x86_64(third column) à kernel version
Later on, represents date & time and last options explain the processor architecture.
Topics Summary
Let's assume, we have logged into a machine's terminal windows and want to check below details...
2.How to check the type of operating system of the server?
3.Command to check the kernel release of the system?
4.Can we check the system hostname information using "uname command?





