Artificial intelligent assistant

How can I populate a file with random data? How can I create a new file and fill it with 1 Gigabyte worth of random data? I need this to test some software. I would prefer to use `/dev/random` or `/dev/urandom`.

On most unices:


head -c 1G myfile


If your `head` doesn't understand the `G` suffix you can specify the size in bytes:


head -c 1073741824 myfile


If your `head` doesn't understand the `-c` option (it's common but not POSIX; you probably have OpenBSD):


dd bs=1024 count=1048576 myfile


Do not use `/dev/random` on Linux, use `/dev/urandom`.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy ca7bb08a023b23b9db3647b62046a3da