Skip to content

rand_string

Usage
rand_string [COMPONENTS/MODIFIERS]...

Generates a random, memorable string using a sequence of specified word categories and formatting modifiers. Words are pulled from curated plain-text databases bundled in data/words/.

Modifiers like --separator and --case are evaluated sequentially and apply only to the components that follow them.

Supported Components: A bundled word list (e.g. adjective, animal, color, name, noun, verb) digits= N random digits (e.g. digits=3 -> 842) literal= A static string component (e.g. literal=TEST)

-s, --separator=<sep> Delimiter for subsequent words (dash, underscore, dot, none, or literal chars)
-c, --case=<casing> Casing for subsequent words (lower, upper, title)
-h, --help Show usage help
0 String generated successfully
1 Unknown category or missing word list file

Falls back to random choice if GNU shuf is missing, but shuf is much faster for files with >1000 lines.

Terminal window
rand_string adjective animal
rand_string --case=title color animal --separator=dot digits=4
rand_string literal=TEST --separator=underscore verb noun

Dependencies: shuf

Classification: bypasses-shadow(cat)