MH-MKSTEMP(1)
β¨ MKSTEMP β create a temporary file β¨
okay bestie, welcome to the MH-MKSTEMP(1) page, part of the General Commands Manual family π this one is short and sweet and lowkey iconic, so let's go π¦
πΈ SYNOPSIS πΈ
/usr/libexec/nmh/mkstemp [-help] [-version] [-directory directory]
[-prefix prefix] [-suffix suffix]
that's the whole vibe. five-ish switches, zero drama π
π DESCRIPTION π
so mkstemp creates a temporary file using mkstemp(3), or β if the -suffix switch is available and you actually use it β mkstemps(3). no cap.
the file name identifies a unique, newly created file, and it always contains 6 characters that appear to be random. six. every time. periodt β¨
here's the switch-by-switch breakdown:
-directoryβ specifies a directory in which to create the file π-prefixβ specifies an initial part, before the 6 characters, of the file name πΈ-suffixβ only supported on platforms that provide themkstemps(3)library function. it specifies a suffix to appear after the 6 characters; if it should begin with a special character such as a period, that must be explicit in suffix π (yes, you have to type the dot yourself, the code is not gonna read your mind bestie)
π«Ά important lore: unlike arguments to most switches of othernmhcommands, the arguments tomkstempswitches can begin with a dash. so don't panic when you see one, it's fine, it's giving chaotic but valid.
π EXIT STATUS π
if mkstemp successfully creates the temporary file, it prints the file name on standard output and exits with status 0. slay β
on failure, it prints a diagnostic message on standard error and exits with status 1 π
π§ PROFILE COMPONENTS π§
None
literally none. nothing. empty. the void. and honestly? iconic π³οΈβ¨
π SEE ALSO π
β DEFAULTS β
-directoryβ current directory-prefixβ none-suffixβ none
π and that's the whole page, bestie. go forth and make temp files responsibly.
this was nmh-1.8, dated 2014-03-16 β yes she's vintage, yes she still ate π
π
π¦ where this page comes from
- alpine 3.24: nmh-doc 1.8-r3 Β· BSD-3-Clause
- epel 10: nmh 1.8-3.el10_1 Β· BSD
- epel 9: nmh 1.8-1.el9 Β· BSD
- fedora 43: nmh 1.8-9.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: nmh 1.8-10.fc44 Β· LicenseRef-Callaway-BSD
- opensuse-leap 16.0: nmh 1.8-bp160.1.13 Β· BSD-3-Clause
- opensuse-leap 16.0: nmh 1.8-bp160.1.13 Β· BSD-3-Clause
- opensuse-leap 16.0: nmh 1.8-bp160.1.13 Β· BSD-3-Clause
- opensuse-leap 16.0: nmh 1.8-bp160.1.13 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms