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


<<:  不是进行渗透测试的最佳时机

>>:  How to Reset forgotten root password in RHEL/CentOS 7/8

Day 29:管理

前言 我们经常会说换位思考,也就是说,身为工程师,如果能清楚知道管理阶级的想法,就能聪明有效率的做事...

django新手村2 ------创建models

上一篇提到 主urls->次urls->views->models->vie...

[Day3] - 前端,後端是在做什麽? --续 前端後端的历史及架构

其实每个时期程序流行的架构以及写法会略有不同,每个时期前端後端负责的范畴也不尽相同,我们无法知道我们...

Day 16:堆积(heap)与字首树(trie)

上一回写到树,今天的主题是以树结构为基础的资料结构。 堆积 二元树(binary tree)是每个节...

Day07:【TypeScript 学起来】原始资料型别 Primitive Types

Q: 软件工程师最常说的谎言有哪些? A: //TODO 连假结束 wednesday blue ...