添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Tutorial

How To Generate Universally Unique Identifiers (UUIDs) with uuidgen

Updated on October 16, 2020
author author

joshtronic and Brian Hogan

How To Generate Universally Unique Identifiers (UUIDs) with uuidgen

Introduction

Generating a UUID

      1. Generating Multiple UUIDs

        1. Using UUIDs in Test Data

            1. mailinator.com](https://mailinator.com], you will not only have a list of realistic-looking data, but it will be a list email addresses you could actually use or monitor in tests. Try the following command:

              1. for i in {1..10}; do echo `uuidgen`@mailinator.com; done

                This time you’ll see output like this:

                Output
                [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]

                Finally, to save the output of this command to a file, you can append > /path/to/some/file to pipe the output:

                1. for i in {1..10}; do echo `uuidgen`@mailinator.com; done > /tmp/emails.txt

                  Then use the cat command to view the file you just created:

                  1. cat /tmp/emails.txt

                    The file is displayed on your screen:

                    Output
                    [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]

                    You can use the same approach to save any of the other examples in this tutorial to files.