Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 2
    To run this in fish shell, use bash -c 'shuf -zer -n20 {A..Z} {a..z} {0..9}' Commented Sep 1, 2020 at 13:29
  • 2
    && printf "\n" Commented Oct 30, 2022 at 9:55
  • Can you make it guarantee at least one selection from each character class? I need to implement the AWS IAM user default password policy. Minimum of three of the following mix of character types: uppercase, lowercase, numbers, and non-alphanumeric character (! @ # $ % ^ & * ( ) _ + - = [ ] { } | '). Commented Nov 8, 2023 at 17:18
  • 1
    Additional characters can be added by separating with spaces. The AWS IAM version requires some escapes: shuf -er -n20 {A..Z} {a..z} {0..9} \! @ \# \$ % ^ \& \* \( \) _ + - = [ ] { } \| \' | tr -d '\n' && printf "\n" Commented Apr 9, 2024 at 16:03