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:


#create uuid (default same as using -r option)
$ uuidgen

#create time based uuid
$ uuidgen -t

#create random uuid
$ uuidgen -r

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 post What is a UUID?

Leave a Reply

How to Generate a UUID in Linux