Claytor
Claytor

Reputation: 51

Command for generating random content of any size in a file

I am looking for a command in Linux/Ubuntu for generating random content of any size into an empty file.

After the latter, I should use the same command to add new random text to another empty file.

I am run out ideas, Do anyone knows what command would be??

Upvotes: 1

Views: 1788

Answers (1)

JUSHJUSH
JUSHJUSH

Reputation: 392

base64 /dev/urandom | head -c 500 > file.txt

This command will write 500 random characters into file.txt. Keep in mind that it will generate only letters, numbers, '+' and '/' characters.

Upvotes: 4

Related Questions