1.\" Copyright (c) 2002 Marcel Moolenaar 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24.\" 25.Dd March 1, 2023 26.Dt UUIDGEN 1 27.Os 28.Sh NAME 29.Nm uuidgen 30.Nd generate universally unique identifiers 31.Sh SYNOPSIS 32.Nm 33.Op Fl 1 34.Op Fl r 35.Op Fl c 36.Op Fl n Ar count 37.Op Fl o Ar filename 38.Sh DESCRIPTION 39The 40.Nm 41utility by default generates a single DCE version 1 42universally unique identifier (UUID), 43also known as a globally unique identifier (GUID). 44The UUID is written to stdout by default. 45The following options can be used to change the behaviour of 46.Nm : 47.Bl -tag -width indent 48.It Fl 1 49This option only has effect if multiple identifiers are to be generated and 50instructs 51.Nm 52to not generate them in batch, but one at a time. 53.It Fl r 54This option controls creation of random UUID (version 4). 55.It Fl c 56This option controls creation of compact UUID (without hyphen). 57.It Fl n 58This option controls the number of identifiers generated. 59By default, multiple identifiers are generated in batch. 60The upper hard limit is 2048 61.Po see 62.Xr uuidgen 2 63.Pc . 64.It Fl o 65Redirect output to 66.Ar filename 67instead of stdout. 68.El 69.Pp 70Batched generation yields a dense set of identifiers in such a way that there 71is no identifier that is larger than the smallest identifier in the set and 72smaller than the largest identifier in the set and that is not already in the 73set. 74.Pp 75When generating the identifiers one at a time, the identifiers will be close 76to each other, but operating system latency and processing time will be 77reflected in the distance between two successive identifiers. 78.Sh EXIT STATUS 79.Ex -std 80.Sh EXAMPLES 81Generate a batch of three UUIDs. 82Notice the similarity of the string before the first hyphen of the UUID 83(known as 84.Em time_low 85in 86.Em rfc4122 87): 88.Bd -literal -offset indent 89$ uuidgen -n3 908bc44345-4d90-11ee-88c7-b42e991fc52e 918bc44346-4d90-11ee-88c7-b42e991fc52e 928bc44347-4d90-11ee-88c7-b42e991fc52e 93.Ed 94.Pp 95Generate a batch of random UUIDs without hyphens: 96.Bd -literal -offset indent 97$ uuidgen -r -c -n3 985ad8b60a0f4e41f59c82d273202275f9 996c41925486cd4bf59720a5bad85de2e4 1008144fdab63f648a1812d12453f975313 101.Ed 102.Pp 103Notice that the UUIDs are not similar to each other. 104.Sh SEE ALSO 105.Xr uuidgen 2 , 106.Xr uuid 3 107.Sh HISTORY 108The 109.Nm 110command first appeared in 111.Fx 5.0 . 112