Files
tldr/pages.zh/osx/mktemp.md

24 lines
593 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# mktemp
> 创建一个临时文件或目录。
> 更多信息:<https://keith.github.io/xcode-man-pages/mktemp.1.html>。
- 创建一个空的临时文件并打印其绝对路径:
`mktemp`
- 使用自定义目录(默认为 `getconf DARWIN_USER_TEMP_DIR` 的输出,或 `/tmp`
`mktemp --tmpdir={{/path/to/tempdir}}`
- 使用自定义路径模板(`X` 将被随机字母数字字符替换):
`mktemp {{/tmp/example.XXXXXXXX}}`
- 使用自定义文件名前缀:
`mktemp -t {{example}}`
- 创建一个空的临时目录并打印其绝对路径:
`mktemp --directory`