How to Generate a UUID in Linux

UUID stands for Universally Unique Identifier. UUIDs are used as IDs (to identify) unique objects or records. An easy way to generate UUIDs in Linux is to use the uuidgen utility on the Linux/Unix command line.

Generating UUID with uuidgen

Simply executing uuidgen will generate a random UUID. Using the -t option will create a UUID based on system time and ethernet address if available. The -r option create a random UUID based mostly on random bits (this is the default). Below are examples of using all three:

For more information about UUID variants, versions, etc. the Wikipedia UUID Page is a great resource. A higher level explanation of UUIDs can also be found in the Big Datums post What is a UUID?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">