# Mktemp

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Mktemp
> Markdown URL: https://mediated.wiki/source/Mktemp.md
> Source: https://en.wikipedia.org/wiki/Mktemp
> Source revision: 1353547674
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Unix command}}
{{Lowercase title}}
{{Infobox software
| name                   = mktemp
| logo                   = 
| screenshot             = 
| screenshot size        = 
| caption                = 
| author                 =
| developer              = Todd Miller, Jim Meyering
| released               = {{Start date and age|1997}}
| latest release version = 
| latest release date    = 
| operating system       = [Unix](/source/Unix) and [Unix-like](/source/Unix-like)
| programming language   = [C](/source/C_(programming_language))
| platform               = [Cross-platform](/source/Cross-platform)
| genre                  = [Command](/source/Command_(computing))
| license                =
| website                = 
}}
'''mktemp''' is a [command](/source/Command-line_interface) available in many [Unix-like](/source/Unix-like) operating systems that creates a temporary file or directory.<ref name=lsb-3.1.0>{{cite web|title=mktemp|url=http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/mktemp.html|website=Linux Standard Base Core Specification 3.1|publisher=Free Standards Group|access-date=7 November 2015}}</ref> Originally released in 1997 as part of [OpenBSD](/source/OpenBSD) 2.1,<ref>{{cite web|last1=Miller|first1=Todd C.|access-date=7 November 2015|title=mktemp manual page|url=https://www.mktemp.org/manual.html#6}}</ref> a separate implementation exists as a part of [GNU Coreutils](/source/GNU_Coreutils).<ref>{{cite mailing list |url=https://lists.gnu.org/archive/html/bug-coreutils/2007-10/msg00051.html |title=announce: new program: mktemp |date=7 October 2007 |accessdate=7 November 2015 |last=Meyering |first=Jim}}</ref>

There used to be a similar named  [C library function](/source/C_(programming_language)), which is now deprecated for being [unsafe](/source/C_standard_library), and has safer alternatives.<ref name=gnutemporaryfiles>{{cite web|title=Temporary Files|url=https://www.gnu.org/software/libc/manual/html_node/Temporary-Files.html|website=GNU|publisher=GNU|access-date=2 September 2019}}</ref>

== See also ==
* [Filesystem Hierarchy Standard](/source/Filesystem_Hierarchy_Standard)
* [Temporary folder](/source/Temporary_folder)
* [TMPDIR](/source/TMPDIR)
* [Unix filesystem](/source/Unix_filesystem)

== References ==
{{Reflist}}

{{Core Utilities commands}}

Category:Unix software
Category:1997 software

{{unix-stub}}

---
Adapted from the Wikipedia article [Mktemp](https://en.wikipedia.org/wiki/Mktemp) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Mktemp?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
