Useful Bash Commands

Generate a random alphanumeric string (8 chars)

$ openssl rand -base64 12 | tr -cd '[:alnum:]' | cut -c -8

Make a string lowercase

$ echo UPPERCASE | tr '[:upper:]' '[:lower:]'

Remove a newline from a string

$ printf 'newline\n' | tr -d '\n'