FreeBSD
Purpose :
Create big files for testing purpose.
Command :
dd
Installation :
The "dd" command comes with the base installation.
Useful switches :
if == input file. By default, dd reads from standard input (stdin)
of == output file name
bs == block size of input & output
count == how many blocks to create for the output file, essentially the size of the file in megabytes
Example :
This would create a file with 100mb in size :
dd if=/dev/random of=myfile.dat bs=$(( 1024 * 1024 )) count=100
And this would create a file with 1000mb in size :
dd if=/dev/random of=myfile.dat bs=$(( 1024 * 1024 )) count=1000
Arrivederci !!!
4 comments:
Nice tip.
You can also use 'mkfile' for things like this. i think it might be quicker for large files, since it uses 0's instead of /dev/random. It's available through ports.
http://www.freshports.org/sysutils/mkfile/
surlyjake, thanks for the tip! :)
freebsd dd also supports the common size units
dd if=inside of=outfile bs=1m count=1k
makes a 1GB file
/dev/zero is much faster data source than /dev/random
Post a Comment