Skip to main content

Quickly Generate Large Test Files on Mac

Posted February 2024 by Steve Sinchak

Are you looking for a large file to test disk file transfers or your internal network speed? Instead of downloading a massive test file and wasting your Internet bandwidth, simply generate one with a simple command right on your Mac. To get started, open up Terminal on your Mac. The mkfile command is going to help us create our file.

stevesinchak@tweaks ~ % mkfile

usage: mkfile [-nv] size[b|k|m|g] filename

The command accepts a few parameters but we are primarily going to be using the size and then the size qualifier of b for bytes, k for kilobytes, m for megabytes, and g for gigabytes. The easiest way to run the command is to cd to the folder you want the file in Terminal, and then simply run mkfile <the size you want><the qualifer> and the <file name>.

Refer to the examples below for how to create different-size test files:

Create a 100 MB file:

mkfile 100m test.file

Create a 1 GB file:

mkfile 1g test.file

Create a 100 GB file:

mkfile 100g test.file

Related Posts


It's pretty well known that battery capacity degrades over time, but did you know you can control how fast the battery degrades based on how you charge it? The lithium-ion battery found in your MacBook is built with the latest technology and macOS (Big Sur and newer) includes special "Optimized Battery Charging" algorithms to extend the battery life. However, these special software optimizations work...

Read More

I recently upgraded my home network from gigabit to 10G so I could take advantage of faster transfers between my Synology NAS, Proxmox server, and workstations. But while editing family video clips stored on my NAS, something did not feel right. Every device was connected at 10GbE, but file copy speeds were slower than expected. This made me wonder, are there bottlenecks in my network?

Read More

Did you know there is a comprehensive screenshot and recording capability built right into modern versions of macOS? That's right, say goodbye to third-party utilities, macOS has you covered. Activated using special keyboard shortcuts (or via terminal), more than a dozen options are available to help you take every type of screenshot you will ever need along with customizations to include a timer delay...

Read More

I recently helped migrate an Office 365 contact list over to the Apple Contacts ecosystem. While there are a lot of off-the-shelf products you can buy, I approached this as a project to build a free CSV to vCard (VCF) conversion tool (built right into this page) that would help anyone else in a similar situation without having to buy or install anything.

Read More