TOOL » LINUX » PACKAGE

Mktemp

Usage

shell
mktemp OPTIONS TEMPLATE
OptionDescription
-d --directoryCreate a directory instead of a file.
-p --tmpdirUse the temporary directory, or the directory set by the option.

TIP

Use several X anywhere for placing the random characters. Only the last group of at least 3 consecutive X are considered for this.

If using mktemp with no options at all, the temporary directory and the tmp.XXXXXXXXXX template is used.

Creating a temporary file in /tmp:

shell
mktemp --tmpdir app-XXXXXXXX

Creating a temporary directory in /tmp:

shell
mktemp --tmpdir --directory app-XXXXXXXX