Linux shell uname -a All In One
Linux shell uname -a
All In One
Linux shell command
https://en.wikipedia.org/wiki/Uname#:~:text=uname
$ uname
# Darwin
$ uname -a
# Darwin xgqfrms-mbp.local 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64
man uname
$ man uname
UNAME(1) BSD General Commands Manual UNAME(1)
NAME
uname -- Print operating system name
SYNOPSIS
uname [-amnprsv]
DESCRIPTION
The uname utility writes symbols representing one or more system charac-
teristics to the standard output.
The following options are available:
-a Behave as though all of the options -mnrsv were specified.
-m print the machine hardware name.
-n print the nodename (the nodename may be a name that the system is
known by to a communications network).
-p print the machine processor architecture name.
:
# man help
$ man uname
UNAME(1) General Commands Manual UNAME(1)
NAME
uname – display information about the system
SYNOPSIS
uname [-amnoprsv]
DESCRIPTION
The uname command writes the name of the operating system implementation to standard output. When options are specified, strings representing one or more system
characteristics are written to standard output.
The options are as follows:
-a Behave as though the options -m, -n, -r, -s, and -v were specified.
-m Write the type of the current hardware platform to standard output. (make(1) uses it to set the MACHINE variable.)
-n Write the name of the system to standard output.
-o This is a synonym for the -s option, for compatibility with other systems.
-p Write the type of the machine processor architecture to standard output. (make(1) uses it to set the MACHINE_ARCH variable.)
-r Write the current release level of the operating system to standard output.
-s Write the name of the operating system implementation to standard output.
-v Write the version level of this release of the operating system to standard output.
If the -a flag is specified, or multiple flags are specified, all output is written on a single line, separated by spaces.
ENVIRONMENT
An environment variable composed of the string UNAME_ followed by any flag to the uname utility (except for -a) will allow the corresponding data to be set to the
contents of the environment variable.
The -m, -n, -r, -s, and -v variables additionally have long aliases that have historically been honored on MacOS, “UNAME_MACHINE”, “UNAME_NODENAME”, “UNAME_RELEASE”,
“UNAME_SYSNAME”, and “UNAME_VERSION” respectively. These names have a higher priority than their shorter counterparts described in the previous paragraph.
See uname(3) for more information.
EXIT STATUS
The uname utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
The hardware platform (-m) can be different from the machine's processor architecture (-p), e.g., on 64-bit PowerPC, -m would return powerpc and -p would return
powerpc64.
SEE ALSO
hostname(1), machine(1), sw_vers(1), sysctl(3), uname(3), sysctl(8)
STANDARDS
The uname command is expected to conform to the IEEE Std 1003.2 (“POSIX.2”) specification.
HISTORY
The uname command appeared in PWB UNIX 1.0, however 4.4BSD was the first Berkeley release with the uname command.
The -K and -U extension flags appeared in FreeBSD 10.0. The -b extension flag appeared in FreeBSD 13.0.
macOS 13.1 November 13, 2020 macOS 13.1
refs
https://www.man7.org/linux/man-pages/man2/uname.2.html
https://github.com/wertarbyte/coreutils/blob/master/src/uname.c
https://www.freebsd.org/cgi/man.cgi?query=uname&sektion=3&n=1
https://www.nsc.ru/cgi-bin/www/unix_help/unix-man?uname+3
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/13599290.html
未经授权禁止转载,违者必究!