fallocate() command equivalent in OS X?

Viewed 13791

Is there a fallocate() equivalent in OS X?

I would like to aggregate all of those equivalent in OS X questions into some doc/table or whatever for everyone. Anybody knows something familiar?

3 Answers

For those wanting to create fake data files for testing, mkfile is pretty elegant. An alternative is to use dd:

dd if=/dev/zero of=zfile count=1024 bs=1024

As you can see with od -b zfile, it's full of zeros. If you want random data (which you may want for testing workflows with data compression, for example), then use "/dev/random" in place of "/dev/zero":

dd if=/dev/random of=randfile count=1024 bs=1024
Related