//View Tip #885
» Get latest stable version of the Linux kernel
» Find and Grep
» Find occurrences of a string in a large code base without firing
» Find occurrences of a string in a large code base without firing
Steve Drees
Similar Tips
» Get real names of current users» Get latest stable version of the Linux kernel
» Find and Grep
» Find occurrences of a string in a large code base without firing
» Find occurrences of a string in a large code base without firing
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
Generate a random 8 character password containing a-z, A-Z and 0-9:
egrep -ioam1 '[a-z0-9]{8}' /dev/urandomComments
Add your comment
#1
On linux I greatly prefer to use pwgen.
Posted 2009-09-16 08:51:00
egrep -oam1 '[A-Za-z0-9]{8}' /dev/random
works much better for me. Dropping the -i option and including A-Z in the regexp speeds it up alot.
works much better for me. Dropping the -i option and including A-Z in the regexp speeds it up alot.
Posted 2009-09-16 10:33:36
There's a perl program that already does this called makepasswd. To use:
makepasswd --chars=20
or you can even add it directly to a user:
usermod -p `makepasswd --chars=20` user
makepasswd --chars=20
or you can even add it directly to a user:
usermod -p `makepasswd --chars=20` user
Posted 2009-09-21 05:57:58

