iT邦幫忙

0

uname Command in Linux with Examples

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:

  • uname
  • lshw
  • lscpu
  • lsblk
  • lsusb
  • dmidecode etc..

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:

  • Operating System Name
  • Kernel Name and Version
  • Kernel Release Information
  • Network node Hostname/System Hostname
  • System Hardware Name
  • Processor Information
  • Hardware Platform/Architecture details

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

Complete Story


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言