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