linux uname命令_Linux Uname命令教程,并带有列出操作系统,内核,机器,处理器体系结构的示例...

本文介绍 Linux 中的 uname 命令,该命令用于获取系统内核、主机名、处理器架构等信息。文章详细解释了如何使用不同的选项来获取所需的信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

linux uname命令

linux uname命令

uname  command is a simple tool that provides information about the kernel, machine, processor, and operating system. There are a lot of more complex and feature applications that can provide more information but the simplicity makes uname best choose.

uname命令是一个简单的工具,可提供有关内核,机器,处理器和操作系统的信息。 有许多可以提供更多信息的更复杂的功能应用程序,但是简单性使它们成为最佳选择。

句法 (Syntax)

We will use the following syntax for uname command.

我们将对uname命令使用以下语法。

uname [OPTION]...

帮帮我 (Help)

Brief help can be displayed with the --help option.

简短的帮助可以使用--help选项显示。

$ uname --help
Help
Help
帮帮我

显示内核名称(Display Kernel Name)

Kernel name is set by compiling the kernel. Distributions generally provide their name in the kernel name or they set their original versioning convention. We can list kernel name with -s or --kernel-name option.

内核名称是通过编译内核设置的。 发行版通常在内核名称中提供其名称,或者它们设置其原始版本约定。 我们可以使用-s--kernel-name选项列出内核名称。

$ uname -s
Display Kernel Name
Display Kernel Name
显示内核名称

显示主机名(Display Host Name)

We can display the hostname of the system with -n or --nodename options. The other name of the hostname is the node name.

我们可以使用-n--nodename选项显示系统的主机名。 主机名的另一个名称是节点名称。

$ uname -n
Display Host Name
Display Host Name
显示主机名

显示内核发布(Display Kernel Release)

We can display kernel release information. This information may be useful while looking for security vulnerabilities or comp-ability options about the application and kernel-related tools. We will use -r or --kernel-release options.

我们可以显示内核发行信息。 在查找有关应用程序和内核相关工具的安全漏洞或兼容性选项时,此信息可能很有用。 我们将使用-r--kernel-release选项。

$ uname -r
Display Kernel Release
Display Kernel Release
显示内核发布

显示内核版本(Display Kernel Version)

Kernel version provides information like when the kernel is compiled what distribution is used. We can display kernel version information with –v option.

内核版本提供了诸如在编译内核时使用何种发行版之类的信息。 我们可以使用– v选项显示内核版本信息。

$ uname -v
Display Kernel Version
Display Kernel Version
显示内核版本

显示处理器(Display Processor)

There is a lot of different type of processors in the IT world. ARM, X86, X86_64, MIPS, etc. Each processor architecture requires kernel compiled for its architecture to work. We can get kernel architecture and related processor type with -p or --processor options.

IT世界中有许多不同类型的处理器。 ARM,X86,X86_64,MIPS等。每种处理器体系结构都需要编译内核才能使其体系结构正常工作。 我们可以使用-p--processor选项获取内核体系结构和相关的处理器类型。

$ uname -p
Display Processor
Display Processor
显示处理器

显示操作系统(Display Operating System)

Operating system information can be listed with -o option.

可以使用-o选项列出操作系统信息。

$ uname -o
Display Operating System
Display Operating System
显示操作系统

显示所有信息(Display All Information)

Up to now we have listed and displayed related information part by part. We can print and display all information in a single line with a single option. We will use -a or --all option.

到目前为止,我们已经部分列出并显示了相关信息。 我们可以使用一个选项在一行中打印和显示所有信息。 我们将使用-a--all选项。

$ uname -a
Display All Information
Display All Information
显示所有信息

We can see that the current system Linux Kernel version is 4.8 and the operating system is Ubuntu.

我们可以看到当前系统Linux Kernel版本是4.8 ,操作系统是Ubuntu。

LEARN MORE  How To Get Ram Size In Linux?
了解更多如何在Linux中获得Ram大小?

翻译自: https://www.poftut.com/linux-uname-command-tutorial-examples-list-operating-system-kernel-machine-processor-architecture/

linux uname命令

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值