OSNAME(1)

NAME
osname - print name of operating system

SYNOPSIS
osname [-format format]
osname -group| -machine| -os| -release| -relgroup| -path
osname -all| -a

DESCRIPTION
The goal of osname is to provide the operating system name and version, and the effective processor type of the running system in a standardized format.

Special logic has been added for cases where discovered information is ambiguous, insufficient or superfluous. Using osname centralizes the management of such special handling.

On systems with the SunOS kernel, osname has special cases for ``sunos'' and ``solaris'', so that callers can differentiate between the two operating systems.

On systems with a Linux kernel, osname uses the distribution ID and release information from lsb_release(1). If lsb_release(1) isn't available, information from /etc/issue is used as a last resort.

On systems with the Darwin kernel, osname uses the product name and version information from sw_vers(1).

Systems that derive their kernel name from the nodename are identified as the ``svr4'' operating system.

On all other systems, the kernel name and version information from uname(1) is used directly.

OPTIONS
If osname is invoked with no output elements specified, it will print just the name of the operating system (-format '%n').

The following identifiers can be used with the -format option to select output elements:

%m  Processor type (e.g. “sparc”, “i386” or “mips” ).

%n  Name of operating system.

%r  Major and minor release version number of operating system.

%u  Update (full) release version number of operating system.

%v  Major release version number of operating system.

Identifiers can be repeated in the format string as many times as necessary to achieve the desired output. Other characters will simply be copied to the output as is.

The following predefined format options are also recognized:

-group
    Same as -format '%n-%m'

-machine
    Same as -format '%m'

-os Same as -format '%n.%v'

-release
    Same as -format '%n-%r'

-relgroup
    Same as -format '%n-%r-%m'

-path
    Same as -format '%n.%v.%m'

The -all or -a option can be used to output a list of the different fields and their values. This is useful for capturing the information into other systems.

SEE ALSO
uname(1), lsb_release(1), sw_vers(1), issue(5)

AUTHORS
-nosplit Kimmo Suominen, Greg Lindahl, Christos Zoulas and Mark Moraes.

ORIGIN
D. E. Shaw & Co.