Random data

Random number

Creating a random number can be useful when performing a sleep action, or getting a random line from a file.

shuf -i 1-10 -n 1

Select 1 number (-n 1) between 1 and 10.

Random string for password

With the functions from OpenSSL we can generate a random password. To make it a bit more readable, we can use base64 encoding.

openssl rand -base64 48

Use randomize function and encode with base64

    Relevant random data commands

    Like to learn more about the commands used in this section? Have a look at the cheat sheets or the related command page.

    • openssl
    • shuf