MKTEMP(1) General Commands Manual MKTEMP(1)

# [NAME](#NAME)

mktemp - Create a temporary file or directory.

# [SYNOPSIS](#SYNOPSIS)

**mktemp** \[OPTION]... \[TEMPLATE]

# [DESCRIPTION](#DESCRIPTION)

Create a temporary file or directory.

# [OPTIONS](#OPTIONS)

[**-d**, **--directory**](#d)

Make a directory instead of a file

[**-u**, **--dry-run**](#u)

do not create anything; merely print a name (unsafe)

[**-q**, **--quiet**](#q)

Fail silently if an error occurs.

[**--suffix** *&lt;SUFFIX&gt;*](#suffix)

append SUFFIX to TEMPLATE; SUFFIX must not contain a path separator. This option is implied if TEMPLATE does not end with X.

[**-p** *&lt;DIR&gt;*](#p)

short form of --tmpdir

[**--tmpdir**\[=*&lt;DIR&gt;*\]](#tmpdir)

interpret TEMPLATE relative to DIR; if DIR is not specified, use $TMPDIR ($TMP on windows) if set, else /tmp. With this option, TEMPLATE must not be an absolute name; unlike with -t, TEMPLATE may contain slashes, but mktemp creates only the final component

[**-t**](#t)

Generate a template (using the supplied prefix and TMPDIR (TMP on windows) if set) to create a filename template \[deprecated]

[**-h**, **--help**](#h)

Print help

[**-V**, **--version**](#V)

Print version

\[*template*]

# [VERSION](#VERSION)

v(uutils coreutils) 0.12.0

2026-10-08

---

Document: mktemp(1) from uutils 0.12.0-r2 (Chainguard OS)
Source: https://github.com/uutils/coreutils
