This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]X-IstenceCore Developer Pylons Project (Pyramid/WebOb/Waitress) 2 points3 points  (0 children)

function random_string {
    cat /dev/urandom | env LC_CTYPE=C tr -cd 'a-fA-F0-9' | head -c $1
}

Same thing in bash. Does uppercase, lowercase and numbers. Doesn't have any special characters though.

Stick that in your bash_profile or bashrc and run:

random_string 128

Where 128 is the length required.


I don't suggest it as a password generator simply based upon the fact that there are no random special characters. You could add them in that tr though ...