Creating a very large random file I wanted to create a 300GB file with random data so I used this command in terminal

dd if=/dev/urandom of=random.txt bs=300g count=1


But what I receive is

dd: /dev/urandom: Invalid argument
0+0 records in
0+0 records out
0 bytes transferred in 0.000042 secs (0 bytes/sec)


I originally thought that is due to not writing bs=300G but capitalizing gives me dd: bs: illegal numeric value.

Thanks for the help in advance.
You can't read 300 gigabytes at once (in one block). Try

dd if=/dev/urandom of=random.bin bs=2g count=150


instead.