Uname

Last updated
uname
Developer(s) AT&T Bell Laboratories, David MacKenzie.
Operating system Unix and Unix-like
Platform Cross-platform
Type Command
License coreutils: GPL-3.0-or-later

uname (short for unix name) is a computer program in Unix and Unix-like computer operating systems that prints the name, version and other details about the current machine and the operating system running on it.

Contents

History

The uname system call and command appeared for the first time in PWB/UNIX. Both are specified by POSIX. [1] [2] The GNU version of uname is included in the "sh-utils" or "coreutils" packages. uname itself is not available as a standalone program. The version of uname bundled in GNU coreutils was written by David MacKenzie. [3] The command is available as a separate package for Microsoft Windows as part of the GnuWin32 project [4] and the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities. [5]

Examples

On a system running Darwin, the output from running uname with the -a command-line argument might look like the text below:

$ uname-a Darwin Roadrunner.local 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26 11:58:09 PST 2010; root:xnu-1504.3.12~1/RELEASE_I386 i386

The following table contains examples from various versions of uname on various platforms. [6]

DistributionSystem (or kernel) (-s)
POSIX
Operating System (or distribution) (-o)Machine (-m)
POSIX
Processor (-p)Hardware platform (-i or -M)OS (kernel) version (-v)
POSIX
OS (kernel) release (-r)
POSIX
Android 4.2.1 on Nexus 4 LinuxGNU/Linuxarmv7lUn­knownUn­known#1 SMP PREEMPT Thu Nov 8 15:42:02 PST 20123.4.0-perf-ge039dcb
Android 2.3 on Meteorit netbookLinuxGNU/Linuxarmv6lUn­knownUn­known
any, coreutils 7.1 Linux GNU/Linuxsparc64sparc64 UltraSPARC T1 (Niagara)(all)(all)
any, coreutils 7.1–8.4 Linux GNU/Linuxppc64ppc64 PPC 970FX (XServe G5)(all)(all)
Arch Linux Linux GNU/Linuxx86_64Un­knownUn­known#1 SMP PREEMPT_DYNAMIC Tue, 04 Oct 2022 19:16:52 +00006.0.0-arch1-1
A/UX 3.1A/UXillegal optionmc68030illegal optionillegal optionSVR23.1
busybox-w32 1.27 (32-bit) on Windows 10Windows_NTMS/Windowsi686Un­knownUn­known92006.2
busybox-w32 1.27 (64-bit) on Wine 2.0Windows_NTMS/Windowsx86_64Un­knownUn­known37905.2
CentOS 6.5, Pentium SU4100 Linux GNU/Linuxi686i686i386#1 SMP Fri Nov 22 00:26:36 UTC 20132.6.32-431.el6.i686
Cray UNICOS 9.0.2.2 sn5176style="background:#FFC7C7;color:black;vertical-align:middle;text-align:center;" class="table-no"|illegal option CRAY Y-MPstyle="background:#FFC7C7;color:black;vertical-align:middle;text-align:center;" class="table-no"|illegal optionstyle="background:#FFC7C7;color:black;vertical-align:middle;text-align:center;" class="table-no"|illegal option sin.0 9.0.2.2
Cygwin (Windows XP), Pentium 4CYGWIN_NT-5.1Cygwini686Un­knownUn­known2006-01-20 13:281.5.19(0.150/4/2)
Cygwin 1.7 (Windows 7 32-bit), Core i7CYGWIN_NT-6.1Cygwini686Un­knownUn­known2012-07-20 22:551.7.16(0.262/5/3)
Cygwin 1.7 (Windows 7 64-bit), Core i7CYGWIN_NT-6.1-WOW64Cygwini686Un­knownUn­known2012-05-09 10:251.7.15(0.260/5/3)
Cygwin 1.7 64 bit (Windows 7 64-bit)CYGWIN_NT-6.1Cygwinx86_64Un­knownUn­known2014-02-09 21:061.7.28(0.271/5/3)
Cygwin 2.2 64 bit (Windows 10 64-bit)CYGWIN_NT-10.0Cygwinx86_64Un­knownUn­known2015-08-20 11:422.2.1(0.289/5/3)
DJGPP v2 32 bit (Windows Server 2008)MS-DOSstyle="background:#FFC7C7;color:black;vertical-align:middle;text-align:center;" class="table-no"|illegal optioni686style="background:#FFC7C7;color:black;vertical-align:middle;text-align:center;" class="table-no"|illegal optionstyle="background:#FFC7C7;color:black;vertical-align:middle;text-align:center;" class="table-no"|illegal option505
Debian 6.0.5 on Raspberry Pi BLinuxGNU/Linuxarmv6lUn­knownunknown (-i)
invalid (-M)
#90 Wed Apr 18 18:23:05 BST 2012 / #538 PREEMPT Fri Aug 30 20:42:08 BST 20133.1.9+ / 3.6.11+
Debian on WD MyBookLive LinuxGNU/LinuxppcUn­knownunknown (-i)
invalid (-M)
#1 Fri Oct 15 17:13:23 PDT 20102.6.32.11-svn21605
Debian GNU/Hurd GNUGNUi686-AT386Un­knownunknown (-i)
illegal option (-M)
GNU-Mach 1.3.99-486/Hurd-0.30.3
Debian GNU/kFreeBSD 6.0, AMDGNU/kFreeBSDGNU/kFreeBSDx86_64amd64AMD Sempron(tm) Processor 3000+#0 Thu Nov 26 04:22:59 CET 20098.0-1-amd64
DragonFlyBSD DragonFlyillegal optioni386i386GENERICDragonFly v2.13.0.749.g93fef-DEVELOPMENT #0: …2.13-DEVELOPMENT
DragonFlyBSD 2.7, AMD64DragonFlyillegal optionx86_64x86_64[filename of kernel conf file]DragonFly v2.7.3.122.g0ba92-DEVELOPMENT #0: Tue June 8 16:50:35 CEST 20102.7-DEVELOPMENT root@Chance.: /usr/obj/usr/src/sys/X86_64_GENERIC
Fedora 19LinuxGNU/Linuxi686i686i386#1 SMP Fri Mar 7 17:22:54 UTC 20143.13.6-100.fc19.i686
FreeBSD 6.1, IntelFreeBSDillegal optioni386i386[kernel name from kernel conf file. i.e.: GENERIC]FreeBSD 6.1-RELEASE-p15 #1: Sun Apr 15 18:04:51 EDT 20076.1-RELEASE-p15
FreeBSD 9.0, IntelFreeBSDFreeBSDamd64amd64[kernel name from kernel conf file. i.e.: GENERIC]FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC9.0-RELEASE
Gentoo, UltraSparc IIe Linux GNU/Linuxsparc64sun4uTI UltraSparc IIe (Hummingbird)#1 SMP Wed Nov 10 02:04:26 CET 20102.6.34-gentoo-r12
Haiku R1/Alpha 1, QEMU Haiku HaikuBePCUn­knownUn­knownr33109 Sep 12 2009 17:45:451
HP-UX HP-UXillegal option9000/712illegal option[Unique machine ID number or node name if cannot be determined.]UB.11.11
HP-UX 11i v3HP-UXillegal optionia64illegal option[Unique machine ID number or node name if cannot be determined.]UB.11.31
GNU Hurd GNUGNUi686-AT386unknownunknownGNU-Mach 1.8+git20190109-486/Hurd-0.90.9
IBM AIX PS/2 v1.3AIXillegal optioni386illegal optionillegal option13.0
IBM AIX 5.3AIXillegal option(serial number of machine)powerpcIBM,8205-E6B53
IBM AIX 7.1AIXillegal option(serial number of machine)powerpcIBM,7891-73X71
IBM AIX 7.2AIXillegal option(serial number of machine)powerpcIBM,9009-42A72
IBM i 5.3 with QSHOS400(hostname)(serial number of machine)Un­knownUn­known53
IBM i 6.1 with QSHOS400(hostname)(serial number of machine)Un­knownUn­known61
IBM i 7.1 with QSHOS400(hostname)(serial number of machine)Un­knownUn­known71
Interix (Windows Services for UNIX) 3.5Interixillegal optionx86Intel_x86_Family6_Model28_Stepping10illegal option10.0.7063.06.1
Interix, Subsystem for Unix-based Applications (SUA), AMD64 6.1 (Windows 2008 R2)Interix-genuineintelIntel64_Family_6_Model_26_Stepping_4-10.0.7063.06.1
IRIX IRIXillegal optionIP22mipsillegal option
IRIX 6.5.30, Origin 2000IRIX64illegal optionIP30

IP35

mipsillegal option072020136.5
Linux Mint 10 "Julia" 64-bit Linux GNU/Linuxx86_64Un­knownUn­known#33-Ubuntu SMP Sun Sep 19 20:32:27 UTC 20102.6.35-22-generic
Linux on Xeon Phi LinuxGNU/Linuxk1omk1omk1om#2 SMP Fri Jun 21 13:43:31 EDT 20132.6.38.8-g2593b11
Mac OS X Panther 10.3, PowerBook G4 (2004) Darwin illegal optionPower Macintoshpowerpcillegal optionDarwin Kernel Version 7.8.0: Wed Dec 22 14:26:17 PST 2004; root:xnu/xnu-517.11.1.obj~1/RELEASE_PPC7.8.0
Mac OS X Snow Leopard 10.6, MacBook3,1 (Late 2007) Darwin illegal optioni386i386illegal optionDarwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_I38610.0.0
Mac OS X Lion 10.7.3 build 11D50, MacbookPro7,1 (Late 2010) Darwin illegal optionx86_64i386illegal optionDarwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_6411.3.0
OS X Mountain Lion 10.8.3 build 12D78, MacbookPro10,1 (Mid 2012) Darwin illegal optionx86_64i386illegal optionDarwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_6412.3.0
OS X Mavericks 10.9 build 13A598, MacbookPro5,1 (Mid 2009) Darwin illegal optionx86_64i386illegal optionDarwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_6413.0.0
OS X Yosemite 10.10 build 14A298i, MacbookPro6,2 (Mid 2010) Darwin illegal optionx86_64i386illegal optionDarwin Kernel Version 14.0.0: Tue Jul 15 23:56:31 PDT 2014; root:xnu-2782.1.43.0.2~1/RELEASE_X86_6414.0.0
OS X El Capitan 10.11 build 15A284, MacBookPro10,1 (Mid 2012) Darwin illegal optionx86_64i386illegal optionDarwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_6415.0.0
macOS Sierra 10.12 build 16E195, MacBookPro12,1 (Early 2015) Darwin illegal optionx86_64i386illegal optionDarwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_6416.5.0
macOS High Sierra 10.13.3 build 17D47, MacBookPro12,1 (Early 2015) Darwin illegal optionx86_64i386illegal optionDarwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_6417.4.0
macOS Mojave 10.14.3 build 18D109 Darwin illegal optionx86_64i386illegal optionDarwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_6418.2.0
macOS Catalina 10.15.5 build 19F101 Darwin Darwinx86_64i386MacBookPro15.1Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_6419.5.0
macOS Big Sur 11.0.1 build 20B29 on Apple M1 Darwin illegal optionarm64armillegal optionDarwin Kernel Version 20.1.0: Sat Oct 31 00:07:10 PDT 2020; root:xnu-7195.50.7~2/RELEASE_ARM64_T810120.1.0
macOS Monterey 12.2.1 build 21D62 [7] on Apple M1 Darwin illegal optionarm64armillegal optionDarwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T810121.3.0
Manjaro Linux 0.8.11 64 bit Linux GNU/Linuxx86_64Un­knownUn­known#1 SMP PREEMPT Sat Nov 15 10:54:42 UTC 20143.17.3-1-MANJARO
MidnightBSD 1.0, IntelMidnightBSDMidnightBSDamd64amd64[kernel name from kernel conf file. i.e.: GENERIC]MidnightBSD 1.0 #5 r11989M: Sat Aug 11 13:20:45 EDT 2018 root@stargazer.midnightbsd.org:/usr/obj/usr/src/sys/GENERIC1.0
MINIX 3.1.7, x86Minixillegal optioni686i386illegal option1.73
MinGW 32 bit (Windows 7)MINGW32_NT-6.1Msysi686Un­knownUn­known2018-11-26 09:222.11.2(0.329/5/3)
MinGW 64 bit (Windows 7)MINGW64_NT-6.1Msysx86_64Un­knownUn­known2018-11-26 09:222.11.2(0.329/5/3)
MSYS 32 bit (Windows 7)MSYS_NT-6.1Msysi686Un­knownUn­known2018-11-26 09:222.11.2(0.329/5/3)
MSYS 64 bit (Windows 7)MSYS_NT-6.1Msysx86_64Un­knownUn­known2018-11-26 09:222.11.2(0.329/5/3)
NetBSD NetBSDUn­knowni386i386Un­knownNetBSD 6.0.1 (GENERIC)6.0.1
NonStop OS H06 25NONSTOP_KERNELUn­knownNSE-TUn­knownH0625Un­known
NonStop OS J06 14NONSTOP_KERNELUn­knownNSE-ABUn­knownJ0614Un­known
OpenBSD 5.4 OpenBSD illegal optionamd64amd64illegal optionGENERIC.MP#15.4
openSUSE 10.3, Core2-duo 64-bit Linux GNU/Linuxx86_64x86_64x86_64#1 SMP 2007/09/21 22:29:00 UTC2.6.22.5-31-default
OpenWRT Barrier Breaker r40420 on TL-WR1043ND Linux GNU/LinuxmipsUn­knownunknown (-i)
invalid (-M)
#1 Tue Apr 8 06:30:07 UTC 20143.10.34
QNX QNXx86pcx862010/07/09-14:44:03EDT6.5.0
Red Hat Linux, Fedora Core 6, AMD Turion64 mobileLinuxGNU/Linuxi686athloni386#1 SMP Wed Jan 10 19:28:18 EST 20072.6.19-1.2895.fc6
ReliantUNIX ReliantUNIX-YRM600R4000B20055.45
SINIX SINIX-YRM600R40005.43
Solaris 2.5.1 Intel Platform Edition SunOS Solaris i86pci386i86pcGeneric_103641-425.5.1
Solaris 8 SunOS illegal optionsun4usparcSUNW, UltraAX-i2Generic_117350-505.8
Solaris 9, Sun Fire 280R SunOS illegal optionsun4usparcSUNW, Sun-Fire-280RGeneric_112233-085.9
Solaris 10, Sun Fire V490 SunOS illegal optionsun4usparcSUNW, Sun-Fire-V490Generic_142900-135.10
Solaris 11.1, Sun Fire X4540 SunOS illegal optioni86pci386i86pc11.15.11
OpenIndiana SunOS illegal optioni86pci386i86pcoi_151a85.11
OpenIndiana  Hipster 2018.04 SunOS Solarisi86pci386i86pc illumos-47b8d4b8845.11
OpenIndiana Hipster 2021.10SunOSillumosi86pci386i86pcillumos-b12aaafbf55.11
SmartOS SunOS illegal optioni86pci386i86pcjoyent_20150403T203811Z5.11
OmniOS SunOS illegal optioni86pci386i86pcomnios-a7084245.11
Tru64 OSF1invalidalphaalphainvalid2650V5.1
Ubuntu 11.04LinuxGNU/Linuxx86_64x86_64x86_64#46-Ubuntu SMP Tue Jun 28 15:07:17 UTC 20112.6.38-10-generic
Ubuntu 12.0.4 on Pandaboard ES LinuxGNU/Linuxarmv7larmv7larmv7l#33-Ubuntu SMP PREEMPT Sat Jan 26 00:46:04 UTC 20133.2.0-1425-omap4
Ubuntu 20.0.4LTS on Raspberry Pi 4 Model BLinuxGNU/Linuxaarch64aarch64aarch64#20-Ubuntu SMP Sun Sep 6 05:11:16 UTC 20205.4.0-1018-raspi
Ultrix ULTRIXVAX04.5
Unity Linux LinuxGNU/Linuxi686Intel(R) Core(TM) i5-2520M CPU @ 2.50 GHzunknown (-i)
invalid (-M)
#1 SMP Fri Oct 1 16:46:58 UTC 20102.6.35.7-unity1
UnxUtils 2007 32 bit (Windows Server 2008)WindowsNTillegal optionx86illegal optionillegal option60
(SCO) OpenServer 5.0.6SCO_SV(hostname)i386i386illegal5.0.63.2
(SCO) System V SCO_SVillegali386i386illegal6.0.05
(SCO) UnixWare 7.1.4UnixWareillegal optioni386x86at-i hardware serial/license number, .e.g. 1AB000123 or NUL000000; -M is illegal option7.1.45
UWIN (64 bit Windows 7), Intel Core i5UWIN-W7UWINi686-64x6464/642012-06-265.0/6.1
SYS$UNIX:SH on OpenVMS on VAX emulatorIS/WBillegal optionvax-6340illegal optionillegal optionstd5.0
z/OS USS OS/390Un­known2097Un­known-i/-M: unknown option; -I: z/OS0322.00
Windows Subsystem for Linux (WSL), Ubuntu 18.04LinuxGNU/Linuxx86_64x86_64x86_64#476-Microsoft Fri Nov 01 16:53:00 PST 20194.4.0-18362-Microsoft
Windows Subsystem for Linux (WSL2), Ubuntu 20.04LinuxGNU/Linuxx86_64x86_64x86_64#1 SMP Wed Aug 25 23:20:18 UTC 20215.10.60.1-microsoft-standard-WSL2

See also

Footnotes

  1. uname. The Open Group Base Specifications Issue 7/IEEE Std 1003.1, 2013 Edition. Specifies the command.
  2. uname. The Open Group Base Specifications Issue 7/IEEE Std 1003.1, 2013 Edition. Specifies the function/system call.
  3. uname(1)    Linux User Manual – User Commands
  4. CoreUtils for Windows
  5. Native Win32 ports of some GNU utilities
  6. These are merely meant to broadly represent common systems; actual output may vary depending on hardware type, OS version, and which software patches have been installed.
  7. Find out which macOS your Mac is using

Related Research Articles

The Portable Operating System Interface is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines both the system and user-level application programming interfaces (APIs), along with command line shells and utility interfaces, for software compatibility (portability) with variants of Unix and other operating systems. POSIX is also a trademark of the IEEE. POSIX is intended to be used by both application and system developers.

The Single UNIX Specification (SUS) is a standard for computer operating systems, compliance with which is required to qualify for using the "UNIX" trademark. The standard specifies programming interfaces for the C language, a command-line shell, and user commands. The core specifications of the SUS known as Base Specifications are developed and maintained by the Austin Group, which is a joint working group of IEEE, ISO/IEC JTC 1/SC 22/WG 15 and The Open Group. If an operating system is submitted to The Open Group for certification, and passes conformance tests, then it is deemed to be compliant with a UNIX standard such as UNIX 98 or UNIX 03.

uniq is a utility command on Unix, Plan 9, Inferno, and Unix-like operating systems which, when fed a text file or standard input, outputs the text with adjacent identical lines collapsed to one, unique line of text.

basename is a standard computer program on Unix and Unix-like operating systems. When basename is given a pathname, it will delete any prefix up to the last slash ('/') character and return the result. basename is described in the Single UNIX Specification and is primarily used in shell scripts.

ln (Unix) Unix file management utility

The ln command is a standard Unix command utility used to create a hard link or a symbolic link (symlink) to an existing file or directory. The use of a hard link allows multiple filenames to be associated with the same file since a hard link points to the inode of a given file, the data of which is stored on disk. On the other hand, symbolic links are special files that refer to other files by name.

chown Command used on Unix-like systems to change the owner of a file

The command chown, an abbreviation of change owner, is used on Unix and Unix-like operating systems to change the owner of file system files and directories. Unprivileged (regular) users who wish to change the group membership of a file that they own may use chgrp.

In computing, touch is a command used to update the access date and/or modification date of a computer file or directory. It is included in Unix and Unix-like operating systems, TSC's FLEX, Digital Research/Novell DR DOS, the AROS shell, the Microware OS-9 shell, and ReactOS. The command is also available for FreeDOS and Microsoft Windows.

join is a command in Unix and Unix-like operating systems that merges the lines of two sorted text files based on the presence of a common field. It is similar to the join operator used in relational databases but operating on text files.

tr (Unix) Unix text formatting utility

tr is a command in Unix, Plan 9, Inferno, and Unix-like operating systems. It is an abbreviation of translate or transliterate, indicating its operation of replacing or removing specific characters in its input data set.

wc (Unix) Unix command utility

wc is a command in Unix, Plan 9, Inferno, and Unix-like operating systems. The program reads either standard input or a list of computer files and generates one or more of the following statistics: newline count, word count, and byte count. If a list of files is provided, both individual file and total statistics follow.

pax is an archiving utility available for various operating systems and defined since 1995. Rather than sort out the incompatible options that have crept up between tar and cpio, along with their implementations across various versions of Unix, the IEEE designed a new archive utility pax that could support various archive formats with useful options from both archivers. The pax command is available on Unix and Unix-like operating systems and on IBM i, and Microsoft Windows NT until Windows 2000.

cksum Unix command

cksum is a command in Unix and Unix-like operating systems that generates a checksum value for a file or stream of data. The cksum command reads each file given in its arguments, or standard input if no arguments are provided, and outputs the file's 32-bit cyclic redundancy check (CRC) checksum and byte count. The CRC output by cksum is different from the CRC-32 used in zip, PNG and zlib.

In computing, cmp is a command-line utility on Unix and Unix-like operating systems that compares two files of any type and writes the results to the standard output. By default, cmp is silent if the files are the same; if they differ, the byte and line number at which the first difference occurred is reported. The command is also available in the OS-9 shell.

In computing, tee is a command in command-line interpreters (shells) using standard streams which reads standard input and writes it to both standard output and one or more files, effectively duplicating its input. It is primarily used in conjunction with pipes and filters. The command is named after the T-splitter used in plumbing.

yes (Unix) Unix command

yes is a command on Unix and Unix-like operating systems, which outputs an affirmative response, or a user-defined string of text, continuously until killed.

test is a command-line utility found in Unix, Plan 9, and Unix-like operating systems that evaluates conditional expressions. test was turned into a shell builtin command in 1981 with UNIX System III and at the same time made available under the alternate name [.

In computing, sleep is a command in Unix, Unix-like and other operating systems that suspends program execution for a specified time.

whoami Command on various operating systems

In computing, whoami is a command found on most Unix-like operating systems, Intel iRMX 86, every Microsoft Windows operating system since Windows Server 2003, and on ReactOS. It is a concatenation of the words "Who am I?" and prints the effective username of the current user when invoked.

In computing, which is a command for various operating systems used to identify the location of executables. The command is available in Unix and Unix-like systems, the AROS shell, for FreeDOS and for Microsoft Windows. The functionality of the which command is similar to some implementations of the type command. POSIX specifies a command named command that also covers this functionality.

dirname is a standard computer program on Unix and Unix-like operating systems. When dirname is given a pathname, it will delete any suffix beginning with the last slash ('/') character and return the result. dirname is described in the Single UNIX Specification and is primarily used in shell scripts.