Thursday, September 25, 2014

Create File with Specified File Size on Linux

Linux, Create File With Content & Specified Size
#dd if=/dev/urandom of=3MB bs=1 count=0 seek=3M
#dd if=/dev/urandom of=5MB bs=1 count=0 seek=5M
#dd if=/dev/urandom of=25MB bs=1 count=0 seek=25M
#dd if=/dev/urandom of=50MB bs=1 count=0 seek=50M
#dd if=/dev/urandom of=100MB bs=1 count=0 seek=100M
#dd if=/dev/urandom of=1GB bs=1 count=0 seek=1G

Linux, Create File with No Content & Specified Size
#dd if=/dev/zero of=1GB bs=1 count=0 seek=1G

No comments: