I type this into my terminal when I just need a quick “random” password.
$ date +%s | sha256sum | base64 | head -c 32 ; echo
This is the output:
Adjust the length by changing
-c 32 to something else.
Passwords generated like this are not really random since they’re based on the date. For my purposes it’s perfect but the following might be better suited for you.
$ </dev/urandom tr -dc 'A-Za-z0-9@#$%&_+=' | head -c 32
The output looks similar to the example above but there are now special characters included: