Skip to content

Bash Tricks

This page will hold random bash commands I find useful.

Generate 20 character password

# No special characters
password=$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 23) && echo $password

# With special characters
password=$(tr -dc 'A-Za-z0-9!?%=' < /dev/urandom | head -c 23) && echo $password