0

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??

Claytor
  • 27
  • 7
  • Possible duplicate of [Generate dummy files in bash](https://stackoverflow.com/questions/9800405/generate-dummy-files-in-bash) – Benjamin W. Aug 14 '19 at 13:26

1 Answers1

3
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.

JUSHJUSH
  • 367
  • 1
  • 11