Go to main content

man pages section 1M: System Administration Commands

Exit Print View

Updated: July 2017
 
 

mkfile(1M)

Name

mkfile - create a file

Synopsis

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

Description

mkfile creates one or more files of the specified size that are padded with zeros by default. The default size is in bytes, but it can be flagged as terabytes, gigabytes, kilobytes, blocks, or megabytes, with the t, g, k, b, or m suffixes, respectively. Suffixes can be uppercase or lowercase.

If an administrator wishes to use a file created with mkfile as a swap file, they must first set the sticky bit using chmod(1).

Options

–n

Create an empty filename. The size is noted, but disk blocks are not allocated until data is written to them.

–v

Verbose. Report the names and sizes of created files.

Exit Status

The following exit values are returned:

0

Success.

>0

An error occurred.

Usage

See largefile(5) for the description of the behavior of mkfile when encountering files greater than or equal to 2 Gbyte ( 231 bytes).

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/core-os
Interface Stability
Committed

See Also

chmod(1), swap(1M), attributes(5), largefile(5)