MKTEMP(1) General Commands Manual MKTEMP(1)

mktempmake temporary file name

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

The mktemp utility creates a temporary file with a unique file name by overwriting the trailing ‘Xs’ from template, and writes the resulting file name to the standard output. If template is absent, it defaults to tmp.XXXXXXXXXX and the -t option is implied.

Create a directory instead of a file.
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 option.
Supress error messages.
Generate a path rooted in a temporary directory.
Unlink file before exiting.

Directory in which to place the temporary file when -t option is specified.

The mktemp utility exits 0 on success, and >0 if an error occurs.

Specifying the -u option introduces a race condition.

December 29, 2019 EltaninOS