Quickly create a large file on a Mac OS X system?

macOS has the command mkfile to achieve the same:

mkfile -n 10g temp_10GB_file

Syntax:

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

And here’s the related manual page for mkfile

Cross Platform Alternative (Unix including macOS):

As an alternative you could also you the Unix util dd:

dd if=/dev/zero of=temp_10GB_file bs=1 count=0 seek=10G

Note that on macOS you need to use a lowercase for the unit as follow:

dd if=/dev/zero of=temp_10GB_file bs=1 count=0 seek=10g

And here’s the related manual page for dd

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)