Creating empty files in Linux

I had a need for several files of various sizes to do some network testing with.  I found a very good us for dd here.

dd if=/dev/zero of=10mb-file.bin bs=1024k count=n

Using the above command (and replacing n for a value) allows the creation of empty files with the size specificed. Need a 10Mb file, n = 10. Need a 100Mb file… n = 100. You get the idea.

Related posts:

  1. Burn ISO from command line in Linux Quick and simple way of burning an ISO image from...
  2. Find Text and Find/Replace Easier Than You Think in Linux How to search all files for a text string: grep...
  3. Remove bonded interface in OpenFiler I decided to try and use NIC bonding in OpenFiler...

Related posts brought to you by Yet Another Related Posts Plugin.

This entry was posted in quickfire, tips and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>