Creating a test file

Any suggestions on how to create a large dummy file for test purposes ? I’m using a mac for this course. Been searching the internet. Might be easier just to create large audio file or something.

Well i found a solution so thought I best share it.

Create a Large File from the Command Line

The simplest way to instantly generate a large empty file is to use the ‘mkfile’ command, which can immediately create a file of any size, whether fairly small in bytes or huge in gigabytes. Syntax for mkfile is as follows:

mkfile -n size[b|k|m|g] filename

For example, to create a 1GB file called “LargeTestFile” on the desktop, the command would be:

mkfile -n 1g ~/Desktop/LargeTestFile

The file is created instantly and takes up the full size. Big files created from mkfile are full of zeroes.

You can confirm the generated file size with the finder Get Info command, or by using ls:

ls -lh ~/Desktop/LargeTestFile

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms