1 <?xml version='
1.0'
?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id=
"systemd-id128" xmlns:
xi=
"http://www.w3.org/2001/XInclude">
9 <title>systemd-id128
</title>
10 <productname>systemd
</productname>
14 <refentrytitle>systemd-id128
</refentrytitle>
15 <manvolnum>1</manvolnum>
19 <refname>systemd-id128
</refname>
20 <refpurpose>Generate and print sd-
128 identifiers
</refpurpose>
25 <command>systemd-id128
</command>
26 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
27 <arg choice=
"plain">new
</arg>
31 <command>systemd-id128
</command>
32 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
33 <arg choice=
"plain">machine-id
</arg>
37 <command>systemd-id128
</command>
38 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
39 <arg choice=
"plain">boot-id
</arg>
43 <command>systemd-id128
</command>
44 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
45 <arg choice=
"plain">invocation-id
</arg>
49 <command>systemd-id128
</command>
50 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
51 <arg choice=
"plain">show
</arg>
52 <arg choice=
"opt" rep=
"repeat">NAME|UUID
</arg>
57 <title>Description
</title>
59 <para><command>id128
</command> may be used to conveniently print
60 <citerefentry><refentrytitle>sd-id128
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
61 UUIDs. What identifier is printed depends on the specific verb.
</para>
63 <para>With
<command>new
</command>, a new random identifier will be generated.
</para>
65 <para>With
<command>machine-id
</command>, the identifier of the current machine will be
67 <citerefentry><refentrytitle>machine-id
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
70 <para>With
<command>boot-id
</command>, the identifier of the current boot will be
73 <para>With
<command>invocation-id
</command>, the identifier of the current service invocation
74 will be printed. This is available in systemd services. See
75 <citerefentry><refentrytitle>systemd.exec
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
78 <para>With
<command>show
</command>, well-known IDs are printed (for now, only GPT partition type UUIDs),
79 along with brief identifier strings. When no arguments are specified, all known IDs are shown. When
80 arguments are specified, they may be the identifiers or ID values of one or more known IDs, which are
81 then printed with their name, or arbitrary IDs, which are then printed with a placeholder name. Combine
82 with
<option>--uuid
</option> to list the IDs in UUID style, i.e. the way GPT partition type UUIDs are
85 <para><command>machine-id
</command>,
<command>boot-id
</command>, and
<command>show
</command> may be
86 combined with the
<option>--app-specific=
<replaceable>app-id
</replaceable></option> switch to generate
87 application-specific IDs. See
88 <citerefentry><refentrytitle>sd_id128_get_machine
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
89 for the discussion when this is useful. Support for
<command>show --app-specific=
</command> was added in
94 <title>Options
</title>
96 <para>The following options are understood:
</para>
100 <term><option>-p
</option></term>
101 <term><option>--pretty
</option></term>
103 <listitem><para>Generate output as programming language snippets.
</para>
105 <xi:include href=
"version-info.xml" xpointer=
"v240"/></listitem>
109 <term><option>-P
</option></term>
110 <term><option>--value
</option></term>
112 <listitem><para>Only print the value. May be combined with
113 <option>-u
</option>/
<option>--uuid
</option>.
</para>
115 <xi:include href=
"version-info.xml" xpointer=
"v255"/></listitem>
119 <term><option>-a
<replaceable>app-id
</replaceable></option></term>
120 <term><option>--app-specific=
<replaceable>app-id
</replaceable></option></term>
122 <listitem><para>With this option, identifiers will be printed that are the result of hashing the
123 application identifier
<replaceable>app-id
</replaceable> and another ID. The
124 <replaceable>app-id
</replaceable> argument must be a valid sd-id128 string identifying the
125 application. When used with
<command>machine-id
</command>, the other ID will be the machine ID as
127 <citerefentry><refentrytitle>machine-id
</refentrytitle><manvolnum>5</manvolnum></citerefentry>, when
128 used with
<command>boot-id
</command>, the other ID will be the boot ID, and when used with
129 <command>show
</command>, the other ID or IDs should be specified via the positional arguments.
</para>
131 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
136 <term><option>-u
</option></term>
137 <term><option>--uuid
</option></term>
139 <listitem><para>Generate output as a UUID formatted in the
"canonical representation", with five
140 groups of digits separated by hyphens. See the Wikipedia entry for
141 <ulink url=
"https://en.wikipedia.org/wiki/Universally_unique_identifier#Format">Universally Unique Identifiers
</ulink>
142 for more discussion.
</para>
144 <xi:include href=
"version-info.xml" xpointer=
"v244"/></listitem>
147 <xi:include href=
"standard-options.xml" xpointer=
"help" />
148 <xi:include href=
"standard-options.xml" xpointer=
"version" />
153 <title>Exit status
</title>
155 <para>On success
0 is returned, and a non-zero failure code otherwise.
</para>
159 <title>Examples
</title>
162 <title>Show a well-known UUID
</title>
164 $ systemd-id128 show --value user-home
165 773f91ef66d449b5bd83d683bf40ad16
167 $ systemd-id128 show --value --uuid user-home
168 773f91ef-
66d4-
49b5-bd83-d683bf40ad16
170 $ systemd-id128 show
773f91ef-
66d4-
49b5-bd83-d683bf40ad16
172 user-home
773f91ef66d449b5bd83d683bf40ad16
177 <title>Generate an application-specific UUID
</title>
180 $ systemd-id128 machine-id -u
181 3a9d668b-
4db7-
4939-
8a4a-
5e78a03bffb7
183 $ systemd-id128 new -u
184 1fb8f24b-
02df-
458d-
9659-cc8ace68e28a
186 $ systemd-id128 machine-id -u -a
1fb8f24b-
02df-
458d-
9659-cc8ace68e28a
187 47b82cb1-
5339-
43da-b2a6-
1c350aef1bd1
189 $ systemd-id128 -Pu show
3a9d668b-
4db7-
4939-
8a4a-
5e78a03bffb7 \
190 -a
1fb8f24b-
02df-
458d-
9659-cc8ace68e28a
191 47b82cb1-
5339-
43da-b2a6-
1c350aef1bd1
194 <para>On a given machine with the ID
3a9d668b-
4db7-
4939-
8a4a-
5e78a03bffb7, for the application
195 1fb8f24b-
02df-
458d-
9659-cc8ace68e28a, we generate an application-specific machine ID
196 (
47b82cb1-
5339-
43da-b2a6-
1c350aef1bd1). If we want to later recreate the same calculation on a
197 different machine, we need to specify both IDs explicitly as parameters to
<command>show
</command>.
203 <title>See Also
</title>
204 <para><simplelist type=
"inline">
205 <member><citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
206 <member><citerefentry><refentrytitle>sd-id128
</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
207 <member><citerefentry><refentrytitle>sd_id128_get_machine
</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>