uname(1)

uname1

Display information about the system

Usage

uname [-abiKmnoprsUv]

Overview

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.

As -a, --all on Linux.
-b

Write the kernel's linker-generated build-id to standard output.

Not on Linux, OpenBSD or macOS.
-i

Write the kernel ident to standard output.

Not on OpenBSD or macOS. As -i, --hardware-platform on Linux.
-K

Write the FreeBSD version of the kernel.

Not on Linux, OpenBSD or macOS.
-m

Write the type of the current hardware platform to standard output. (make(1) uses it to set the MACHINE variable.)

As -m, --machine on Linux.
-n

Write the name of the system to standard output.

As -n, --nodename on Linux.
-o

This is a synonym for the -s option, for compatibility with other systems.

Not on OpenBSD. As -o, --operating-system on Linux.
-p

Write the type of the machine processor architecture to standard output. (make(1) uses it to set the MACHINE_ARCH variable.)

As -p, --processor on Linux.
-r

Write the current release level of the kernel to standard output. freebsd-version(1) can be used to print the release level of the userland.

As -r, --kernel-release on Linux.
-s

Write the name of the operating system implementation to standard output.

As -s, --kernel-name on Linux.
-U

Write the FreeBSD version of the user environment.

Not on Linux, OpenBSD or macOS.
-v

Write the version level of this release of the operating system to standard output.

As -v, --kernel-version on Linux.

If the -a flag is specified, or multiple flags are specified, all output is written on a single line, separated by spaces.

The -K and -U flags are intended to be used for fine grain differentiation of incremental FreeBSD development and user visible changes. Note that when both of these two options are specified, regardless of their order, the kernel version would be printed first, followed by the user environment version.

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. 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.

Releases

87 releases since FreeBSD 2.0.5-RELEASE; the text changed 47 times.

  1. 2.0.5–2.1.7.1
  2. 2.2.2
  3. 2.2.5
  4. 2.2.6
  5. 2.2.7–3.5.1
  6. 4.0–4.3
  7. 4.4–4.5
  8. 4.6–4.6.2
  9. 4.7
  10. 4.8–4.11
  11. 5.0–5.1
  12. 5.2–5.2.1
  13. 5.3–5.5
  14. 6.0–6.3
  15. 6.4
  16. 7.0
  17. 7.1
  18. 7.2
  19. 7.3
  20. 7.4
  21. 8.0
  22. 8.1
  23. 8.2
  24. 8.3
  25. 8.4
  26. 9.0
  27. 9.1
  28. 9.2
  29. 9.3
  30. 10.0
  31. 10.1
  32. 10.2
  33. 10.3
  34. 10.4
  35. 11.0
  36. 11.1
  37. 11.2
  38. 11.3
  39. 11.4
  40. 12.0
  41. 12.1
  42. 12.2
  43. 12.3
  44. 12.4
  45. 13.0–13.1
  46. 13.2
  47. 13.3–14.5
  48. 15.0–16.0

-K since FreeBSD 9.3-RELEASE; -U since FreeBSD 9.3-RELEASE; -b since FreeBSD 13.0-RELEASE; -i since FreeBSD 5.2-RELEASE; -o since FreeBSD 8.2-RELEASE; -p since FreeBSD 2.2.7-RELEASE.

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.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.