I donβt know which OS you are using, but the fastest approach would be for us a system copy, to combine files into one large file, you can script. Example. If you start with a string like "1" and echo it to a file
echo "1" > file1
you can associate this file with yourself within a few seconds with the new file, in windows you must use the / b option for the binary copy to do this.
copy /b file1+file1 file2
gives you a file2 of 12 bytes (including CR)
copy file2+file2 file1
gives you 24 bytes, etc.
I will give you the math (and the fun of Rubing this), but you will reach your size fast enough and probably faster than the accepted answer.
source share