ahmedjama.com

Tech | Insights | Inspiration

How to create files with arbitary sizes

mkfile creates one or more files that are suitable for use as NFS- mounted swap areas.

Ahmed Jama

1-Minute Read

tux

mkfile allows you to create files with arbitary sizes. This comes in handy if want to test file transfer speeds between two endpoints and you want use a file with an exact size.

The command below let’s you create 100M file.

$ mkfile -n 100M 100M.data

Below the is the syntax for mkfile

Syntax
          mkfile [ -nv ] size[b|k|m|g] filename ...
Options
   -n     Create an empty filename.  The size is noted,  but  disk  blocks
          aren't allocated until data is written to them.

   -v     Verbose.  Report the names and sizes of created files.

Say Something

Comments

Nothing yet.

Recent Posts

categories

About

This blog is a space for exploring both the technical and thought-provoking aspects of technology, sharing insights and breaking down complex concepts in an accessible and engaging way.