mktemp do?safely create a unique temporary file or directory and print its name.
▸ Explain your own mktemp command →$ mktemp
$ mktemp -d
$ mktemp -p /var/tmp
$ mktemp --suffix=.json
| -d | create a directory instead of a file |
| -u | only print an unused name without creating anything (unsafe) |
| -q | suppress diagnostics if creation fails |
| -p | create the file/dir in this directory instead of $TMPDIR |
| -t | interpret the template relative to the temp directory |
| --suffix | append this suffix to the generated name |
Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.