1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 11:02:08 +02:00
tldr/pages/common/mktemp.md
pixel f8d6aa88dc
mktemp: fix common and standardize between variants (#10700)
* mktemp: fix `common` and standardize variants
* mktemp: add -p example
* linux/mktemp: add -p example
* linux/mktemp: mention `$TMPDIR` in the `-p` example
* osx/mktemp: add page
* linux/mktemp: fix errors
* linux/mktemp: add serial comma
2023-10-03 14:53:31 +02:00

24 lines
594 B
Markdown

# mktemp
> Create a temporary file or directory.
> More information: <https://man.openbsd.org/mktemp.1>.
- Create an empty temporary file and print its absolute path:
`mktemp`
- Use a custom directory if `$TMPDIR` is not set (the default is platform-dependent, but usually `/tmp`):
`mktemp -p {{/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 directory and print its absolute path:
`mktemp -d`