How to Generate Universally Unique Identifiers (UUIDs) with Uuidgen


Universally Unique Identifiers, or UUIDs, are a standardized means of producing and figuring out assets in a globally one of a kind method. These identifiers are often utilized in laptop techniques the place they could recognize information from server databases or community interfaces.

In Linux, you could use the “uuidgen” device to generate UUIDs. In this text, we’ll go over the best way to use the “uuidgen” device to generate UUIDs.

What is a UUID

A UUID is a 128-bit worth which is generated in a means that it’s one of a kind throughout all techniques on the planet. This signifies that you could use a UUID to recognize assets with out having to fret about conflicts with different techniques. The UUID is traditionally represented as a string of 32 hexadecimal characters, separated into communities of 8, 4, 4, 4, and 12 characters.

Generating a UUID

Update the system’s listing of purchasable packages applying the apt replace command:

Now set up the uuid-runtime bundle:

$ sudo apt set up uuid-runtime

After the uuid-runtime bundle is set up, we will generate a generate a single UUID by executing the subsequent command in your terminal:

Following output will show up with a completely different UUID:

You may generate time-based and hash-based UUIDs applying the uuidgen command.

The under command will give time founded UUID:

A random UUID might be obtained applying the uuidgen with “-r”:

Generating Multiple UUIDs

To generate a listing of UUIDs we will use a for loop.

Below command will generate 10 UUIDs randomly:

for i in {1..10}; do uuidgen; finished

You’ll see 10 UUIDs printed to the display:

To generate a customized quantity of UUIDs change the worth 10 with any quantity.


UUIDs are a handy means of uniquely figuring out assets in a globally one of a kind method. The “uuidgen” device in Linux makes it straightforward to generate UUIDs, making it a great tool for builders and system directors. Whether you’re engaged on a database, community interface, or different system, applying UUIDs can help you make sure that your assets are uniquely recognized and accessible throughout a number of techniques.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More