MKTEMP(1)

NAME
mktemp - create temporary file or directory

SYNOPSIS
mktemp [-dqtu] [-p directory] [template]

DESCRIPTION
mktemp creates a temporary file by generating a unique filename with template, which has to have at least six 'X's appended to it. If no template is specified, a default of 'tmp.XXXXXXXXXX' is used and the tmpdir set to '/tmp' or, if set, the TMPDIR environment variable.

OPTIONS

-d  Create a temporary directory instead of a file.

-p directory
    Use the specified directory as a prefix when generating the temporary filename. The directory will be overridden by the user's TMPDIR environment variable if it is set. This option implies the -t flag (see below).

-q  Fail silently if an error occurs.

-t  Generate a path rooted in a temporary directory.

-u  Unlink file before mktemp exits. This is slightly better than mktemp(3) but still introduces a race condition. Use of this option is not encouraged.

SEE ALSO
mkdtemp(3), mkstemp(3)