MKTEMP(1)

πŸ“¦
version 9.10 Β· 5 versions
, in ubuntu stonking

πŸ’– MKTEMP(1) β€” the group chat edition πŸ’–

okay so bestie, you know how the manual name is MKTEMP(1) and it lives in the User Commands section? yeah. that's us. that's the vibe. let's go πŸ¦‹


✨ NAME ✨

mktemp β€” create a temporary file or directory. literally its whole thing. icon behavior. πŸ’…


🌸 SYNOPSIS 🌸

mktemp [OPTION]... [TEMPLATE]

πŸŽ€ DESCRIPTION πŸŽ€

So the assignment is: make a temporary file or directory, safely, and print its name. that's it, that's the job, and she does it flawlessly every single time no cap 🫢

Your TEMPLATE has one non-negotiable rule: it must contain at least 3 consecutive X's in the last component. three. minimum. that's the price of admission, bestie 😀

If you don't hand over a TEMPLATE at all, she'll just use tmp.XXXXXXXXXX, and --tmpdir is implied. she's got you, don't stress πŸ’œ

Also, for the record: files get created u+rw, and directories get u+rwx, minus whatever your umask restrictions say. so like, the umask still gets a say in this. she's not above the umask. nobody is. 😭


✨ the flags, bestie ✨

  • -d, --directory β€” create a directory, not a file. plot twist but make it organized πŸŽ€
  • -u, --dry-run β€” do not create anything at all, just print a name. sounds cute, and it is, but heads up: this is unsafe. not me being dramatic, the manpage literally says unsafe. so like. respect the red flag 🚩
  • -q, --quiet β€” suppress diagnostics about file/dir-creation failure. she'll just quietly not tell you. silence is golden, or whatever 😌
  • --suffix=SUFF β€” append SUFF to TEMPLATE; SUFF must not contain a slash. and fun fact: this option is implied if TEMPLATE doesn't end in X.
  • -p DIR, --tmpdir[=DIR] β€” interpret TEMPLATE relative to DIR; if DIR isn't specified, use $TMPDIR if it's set, else /tmp. With this option, TEMPLATE must not be an absolute name. and unlike with -t, TEMPLATE may contain slashes β€” but mktemp only creates the final component. yeah, only the last one. the rest is just vibes and hopes and dreams 🌈
  • -t β€” interpret TEMPLATE as a single file name component, relative to a directory: $TMPDIR, if set; else the directory specified via -p; else /tmp. [deprecated] β€” she's an icon but she's retired, okay? still works, still listed, but like. deprecated πŸ’€
  • --help β€” display this help and exit. the classic. πŸ₯°
  • --version β€” output version information and exit. 🌟

πŸ‘‘ AUTHOR πŸ‘‘

Written by Jim Meyering and Eric Blake. legends. absolute main characters. we thank them for their service πŸ«‘πŸ’–


πŸ› REPORTING BUGS πŸ›

Found a bug? spill it, bestie:


πŸ¦‹ SEE ALSO πŸ¦‹

Full documentation at <https://www.gnu.org/software/coreutils/mktemp>

or available locally via:

info '(coreutils) mktemp invocation'

Packaging tea β˜•: Packaged by Ubuntu (9.10-1ubuntu2) Copyright Β© 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

and that's the whole page, bestie πŸ’œ this was GNU coreutils 9.10, from August 2026, filed under MKTEMP(1) β€” mwah, take care of her, and remember: three X's minimum, no absolute paths with -p, and -u is unsafe fr fr πŸ˜˜βœ¨πŸŽ€

πŸ“¦ where this page comes from