命令行基础知识:生成UUID

Universally unique identifiers (UUIDs) are 128-bit numbers that are accepted as being unique on the local system they are created on as well as among the UUIDs created on other systems in the past as well as the future. Because of their uniqueness, they can be created on both the client and server and come in really handy in situations where an auto incremented primary key can fall short.

通用唯一标识符(UUID)是128位数字,在创建它们的本地系统以及过去和将来在其他系统上创建的UUID中,它们被认为是唯一的。 由于它们的独特性,它们可以在客户端和服务器上创建,并且在自动递增主键可能不足的情况下非常有用。

Because of their uniqueness, UUIDs are well suited for generating test data. Need a random string? A UUID is fine. What about an email? [email protected] is great. Need a bunch of random string? UUIDs will be unique, making them easy to track down as they move through a system.

由于其独特性,UUID非常适合生成测试数据。 需要一个随机字符串吗? UUID可以。 电子邮件呢? [email protected]很棒。 需要一堆随机字符串吗? UUID将是唯一的,从而使它们在系统中移动时易于跟踪。

入门 (Getting started)

To generate universally unique identifiers from the command-line you will need the uuidgen utility.

要从命令行生成通用的唯一标识符,您将需要uuidgen实用程序。

Fortunately, the command is pretty standard issue on Unix-like operating systems like Linux and macOS.

幸运的是,在像Unix之类的操作系统(例如Linux和macOS)上,该命令是非常标准的问题。

If you don’t happen to have the command available (try running it to see) please consult with your system’s package manager and see if it’s available.

如果您碰巧没有该命令可用(请尝试运行该命令以查看),请咨询系统的程序包管理器并查看其是否可用。

Also worth noting, the macOS version of uuidgen does function a bit differently than that of the Linux version in that is returns UUIDs in all capital letters.

同样值得注意的是, uuidgen的macOS版本与Linux版本的功能确实有所不同,因为它以所有大写字母返回UUID。

For the sake of example, this shoul

你可能感兴趣的:(python,linux,java,shell,大数据)