1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/linux/mktemp.md
K.B.Dharun Krishna 898f711019
pages/*: update GNU coreutils links, sync translation pages (#15543)
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2025-01-18 18:45:33 +05:30

28 lines
723 B
Markdown

# mktemp
> Create a temporary file or directory.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/mktemp-invocation.html>.
- Create an empty temporary file and print its absolute path:
`mktemp`
- Use a custom directory (defaults to `$TMPDIR`, or `/tmp`):
`mktemp --tmpdir={{/path/to/tempdir}}`
- Use a custom path template (`X`s are replaced with random alphanumeric characters):
`mktemp {{/tmp/example.XXXXXXXX}}`
- Use a custom file name template:
`mktemp -t {{example.XXXXXXXX}}`
- Create an empty temporary file with the given suffix and print its absolute path:
`mktemp --suffix {{.ext}}`
- Create an empty temporary directory and print its absolute path:
`mktemp --directory`