
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

显示内核名称(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 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 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 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 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 Operating System)
Operating system information can be listed with -o
option.
可以使用-o
选项列出操作系统信息。
$ uname -o

显示所有信息(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

We can see that the current system Linux Kernel version is 4.8
and the operating system is Ubuntu.
我们可以看到当前系统Linux Kernel版本是4.8
,操作系统是Ubuntu。
linux uname命令