Generate a UUID With uuidgen

Create a random RFC 4122 UUID from the shell.

macOSrandomscriptingLow risk
Run uuidgen to print a new random UUID.

01Command

Command
$ uuidgen

02What it does

uuidgen produces a version-4 UUID, useful for filenames, database keys, test fixtures and temporary identifiers. Options can force lowercase or uppercase output; on Linux the same command comes from util-linux.

03Risk

RiskLow risk
CompatibilitymacOS (built-in)
!Warning: A UUID is random, not secret; do not use it as a password or token.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-20 · Category: Developer