152183d01SMarcel Moolenaar.\" Copyright (c) 2002 Marcel Moolenaar 252183d01SMarcel Moolenaar.\" All rights reserved. 352183d01SMarcel Moolenaar.\" 452183d01SMarcel Moolenaar.\" Redistribution and use in source and binary forms, with or without 552183d01SMarcel Moolenaar.\" modification, are permitted provided that the following conditions 652183d01SMarcel Moolenaar.\" are met: 752183d01SMarcel Moolenaar.\" 852183d01SMarcel Moolenaar.\" 1. Redistributions of source code must retain the above copyright 952183d01SMarcel Moolenaar.\" notice, this list of conditions and the following disclaimer. 1052183d01SMarcel Moolenaar.\" 2. Redistributions in binary form must reproduce the above copyright 1152183d01SMarcel Moolenaar.\" notice, this list of conditions and the following disclaimer in the 1252183d01SMarcel Moolenaar.\" documentation and/or other materials provided with the distribution. 1352183d01SMarcel Moolenaar.\" 1452183d01SMarcel Moolenaar.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1552183d01SMarcel Moolenaar.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1652183d01SMarcel Moolenaar.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1752183d01SMarcel Moolenaar.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 1852183d01SMarcel Moolenaar.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 1952183d01SMarcel Moolenaar.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2052183d01SMarcel Moolenaar.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2152183d01SMarcel Moolenaar.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2252183d01SMarcel Moolenaar.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2352183d01SMarcel Moolenaar.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2452183d01SMarcel Moolenaar.\" 250ba66872SBaptiste Daroussin.Dd March 1, 2023 2652183d01SMarcel Moolenaar.Dt UUIDGEN 1 2752183d01SMarcel Moolenaar.Os 2852183d01SMarcel Moolenaar.Sh NAME 2952183d01SMarcel Moolenaar.Nm uuidgen 3052183d01SMarcel Moolenaar.Nd generate universally unique identifiers 3152183d01SMarcel Moolenaar.Sh SYNOPSIS 3252183d01SMarcel Moolenaar.Nm 3352183d01SMarcel Moolenaar.Op Fl 1 34f176fe8eSTobias C. Berner.Op Fl r 35b2b294f2SBaptiste Daroussin.Op Fl c 3652183d01SMarcel Moolenaar.Op Fl n Ar count 3748328654SMarcel Moolenaar.Op Fl o Ar filename 3852183d01SMarcel Moolenaar.Sh DESCRIPTION 3952183d01SMarcel MoolenaarThe 4052183d01SMarcel Moolenaar.Nm 4160fc1eb7SRalf S. Engelschallutility by default generates a single DCE version 1 4260fc1eb7SRalf S. Engelschalluniversally unique identifier (UUID), 4336588206SRuslan Ermilovalso known as a globally unique identifier (GUID). 4448328654SMarcel MoolenaarThe UUID is written to stdout by default. 4548328654SMarcel MoolenaarThe following options can be used to change the behaviour of 4648328654SMarcel Moolenaar.Nm : 4752183d01SMarcel Moolenaar.Bl -tag -width indent 4852183d01SMarcel Moolenaar.It Fl 1 4952183d01SMarcel MoolenaarThis option only has effect if multiple identifiers are to be generated and 5052183d01SMarcel Moolenaarinstructs 5152183d01SMarcel Moolenaar.Nm 5252183d01SMarcel Moolenaarto not generate them in batch, but one at a time. 53f176fe8eSTobias C. Berner.It Fl r 54f176fe8eSTobias C. BernerThis option controls creation of random UUID (version 4). 55b2b294f2SBaptiste Daroussin.It Fl c 564cd30c64SBaptiste DaroussinThis option controls creation of compact UUID (without hyphen). 5752183d01SMarcel Moolenaar.It Fl n 5836588206SRuslan ErmilovThis option controls the number of identifiers generated. 597b9da807SWarren BlockBy default, multiple identifiers are generated in batch. 607b9da807SWarren BlockThe upper hard limit is 2048 617b9da807SWarren Block.Po see 627b9da807SWarren Block.Xr uuidgen 2 637b9da807SWarren Block.Pc . 6448328654SMarcel Moolenaar.It Fl o 6548328654SMarcel MoolenaarRedirect output to 6648328654SMarcel Moolenaar.Ar filename 6748328654SMarcel Moolenaarinstead of stdout. 6852183d01SMarcel Moolenaar.El 6952183d01SMarcel Moolenaar.Pp 7052183d01SMarcel MoolenaarBatched generation yields a dense set of identifiers in such a way that there 7152183d01SMarcel Moolenaaris no identifier that is larger than the smallest identifier in the set and 7252183d01SMarcel Moolenaarsmaller than the largest identifier in the set and that is not already in the 7352183d01SMarcel Moolenaarset. 7452183d01SMarcel Moolenaar.Pp 7552183d01SMarcel MoolenaarWhen generating the identifiers one at a time, the identifiers will be close 7652183d01SMarcel Moolenaarto each other, but operating system latency and processing time will be 7752183d01SMarcel Moolenaarreflected in the distance between two successive identifiers. 78a866e170SRuslan Ermilov.Sh EXIT STATUS 7952183d01SMarcel Moolenaar.Ex -std 80*6e74b603SFernando Apesteguía.Sh EXAMPLES 81*6e74b603SFernando ApesteguíaGenerate a batch of three UUIDs. 82*6e74b603SFernando ApesteguíaNotice the similarity of the string before the first hyphen of the UUID 83*6e74b603SFernando Apesteguía(known as 84*6e74b603SFernando Apesteguía.Em time_low 85*6e74b603SFernando Apesteguíain 86*6e74b603SFernando Apesteguía.Em rfc4122 87*6e74b603SFernando Apesteguía): 88*6e74b603SFernando Apesteguía.Bd -literal -offset indent 89*6e74b603SFernando Apesteguía$ uuidgen -n3 90*6e74b603SFernando Apesteguía8bc44345-4d90-11ee-88c7-b42e991fc52e 91*6e74b603SFernando Apesteguía8bc44346-4d90-11ee-88c7-b42e991fc52e 92*6e74b603SFernando Apesteguía8bc44347-4d90-11ee-88c7-b42e991fc52e 93*6e74b603SFernando Apesteguía.Ed 94*6e74b603SFernando Apesteguía.Pp 95*6e74b603SFernando ApesteguíaGenerate a batch of random UUIDs without hyphens: 96*6e74b603SFernando Apesteguía.Bd -literal -offset indent 97*6e74b603SFernando Apesteguía$ uuidgen -r -c -n3 98*6e74b603SFernando Apesteguía5ad8b60a0f4e41f59c82d273202275f9 99*6e74b603SFernando Apesteguía6c41925486cd4bf59720a5bad85de2e4 100*6e74b603SFernando Apesteguía8144fdab63f648a1812d12453f975313 101*6e74b603SFernando Apesteguía.Ed 102*6e74b603SFernando Apesteguía.Pp 103*6e74b603SFernando ApesteguíaNotice that the UUIDs are not similar to each other. 10452183d01SMarcel Moolenaar.Sh SEE ALSO 1059b2f268fSMarcel Moolenaar.Xr uuidgen 2 , 1069b2f268fSMarcel Moolenaar.Xr uuid 3 10752183d01SMarcel Moolenaar.Sh HISTORY 10852183d01SMarcel MoolenaarThe 10952183d01SMarcel Moolenaar.Nm 11052183d01SMarcel Moolenaarcommand first appeared in 11152183d01SMarcel Moolenaar.Fx 5.0 . 112