🧀 Learn Linux

Advanced · Organize files

mktemp:Create a temporary file or directory

Put in free practice

Syntax

mktemp [-d] [template]

Options

-d
Create directory

Examples

mktemp -d /tmp/work.XXXXXX

Usage and sandbox support

The template ends with at least three X, and the parent directory must exist; the file permissions are 600, and the directory permissions are 700. Tutorial names are generated sequentially, real systems use random names.

Hands-on exercises

Full documentation ↗

Related commands