Tech Reflect
  • Home
  • About This Site
  • Contact me
  • Search Icon
Create a test file of a certain size

Create a test file of a certain size

2018-04-03

There are a number of possible reasons you may want to create a file of a specific size. For example:

  • Testing upload/download speed (you may want a very large file, for example)
  • Testing edge conditions related to file size
  • Test the behavior of a mix of large and small files

Probably one of the least complicated UNIX utilities every written is called mkfile and is designed for this purpose. It’s super simple to use:

mkfile <size> <filename>

For size, you just use a number, suffixed by b(bytes), k(kilobytes), m(megabytes), g(gigabytes). So, a specific example:

mkfile 10g TenGigabyte.txt

This creates a 10 gigabyte file called TenGigabyte.txt.

The files will all just be zeroes, but for many purposes, this is fine.

Related Posts:

  • Ultra high volume email workflow
    Ultra high volume email workflow
  • Old Dock tips that are still useful
    Old Dock tips that are still useful

macOS tips

Post navigation

NEXT
Backing up iCloud Drive
PREVIOUS
Quick open files of a certain type

Get Monthly Updates

Recent Posts

  • Flower Power and Blue Dalmatian to the rescue?
  • “Why does Mail have to be so fucking complicated?”
  • This mouse has no tail!
  • Interview feedback and the Thumb-o-meter™
  • Buy a cactus, get hired

Categories

  • analog (1)
  • apple career (11)
  • apple inside (11)
  • apple stories (17)
  • bertrand serlet (3)
  • essays (15)
  • geeky (21)
  • interviews (4)
  • iOS tips (3)
  • Mac OS X (2)
  • macOS tips (37)
  • personal (7)
  • products (4)
  • scott forstall (7)
  • scripting (1)
  • steve jobs (14)
  • tim cook (1)
  • workplace (14)

Get Monthly Updates

About cricket


Me with Guiness the owl

25 years in tech. I like to write manifestos. I like to offer interesting tips. I like making fun of things. Everyone copes differently.

My Other Blogs

  • Free Range Parrots
  • Plucky Tree (personal)
© 2022   All Rights Reserved.