Created
January 23, 2011 04:03
-
-
Save alevchuk/791799 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate 1GB of random numbers and write them to a file | |
perl -e 'print STDERR "Grenerating data...\n"; while (1) { print rand() }' | \ | |
dd count=20971520 bs=512 | perl -e ' | |
# Accumulate and then Measure with dd | |
@all = (); | |
binmode(STDIN); | |
while (read(STDIN, $b, 1048576)) { # Read in 1 MB chunks | |
push(@all, $b); | |
} | |
close(STDIN); | |
print STDERR "\nWriting data...\n"; | |
open(DD, "|dd bs=512 of=bigfile-1gb"); | |
binmode(DD); | |
foreach (@all) { | |
print DD "$_"; | |
} | |
close(DD);' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment