Today you will learn about a command which will help you to get information related to hardware and operating system.
In Linux, there are many commands, with the help of which we can extract information about hardware and software.
Here I have listed some of them:
In this guide, I will explain to you about uname command.
Let’s get started.
uname is a very basic but useful command that helps you get some key information’s like:
You must follow the syntax given below to use the uname command.
uname [OPTION]...
1. Print all Information
You can use -a option to print all the information’s that the uname command can provide.
In fact, you don’t need to remember any of uname command’s other options. Only this option will provide you all the information.
~$ uname -a
Linux ubuntu 5.3.0-28-generic #30~18.04.1-Ubuntu SMP Fri Jan 17 06:14:09 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
As you can see, uname has provided us with a lot of information related to hardware and software.
2. Display the Hostname Name
To display the Hostname of your system pass the -n option to uname.
~$ uname -n
ubuntu
3. Display the Operating System Name
To display the Operating System name pass the -o option to uname.
~$ uname -o
GNU/Linux
4. Print the Kernel Name using uname Command
To Print the Kernel name pass the -s option to uname Command.
~$ uname -s
Linux
5. Print the Kernel Release Information
To Print the Kernel release information pass the -r option to uname.
~$ uname -r
5.3.0-28-generic