</dev/urandom tr -dc '[:alnum:]' | head -c 32 ; echo
And a stronger version,
</dev/urandom tr -dc '[:alnum:][:punct:]' | head -c $(( $RANDOM % 32 + 32 )) ; echo
https://git.zx2c4.com/password-store/tree/src/password-store.sh#n539
@yyp
For completeness' sake, here's a pretty picture [command line password generator (for the search engines)].
And I definitely recommend pass(1).
@torresjrjr I've been using pass until recently. It strictly depends on coreutils, and I'm on Alpine Linux, which kind of defeats the point of Alpine. And there's not that much to gain for me when using pass anyway, since it's just GPG encrypted files and I already know how to manage such :)
@torresjrjr Thanks! That's way cleaner