Mktemp: Difference between revisions
Jump to navigation
Jump to search
Line 16: | Line 16: | ||
=Options= | =Options= | ||
==<tt>-d</tt>== | |||
==-d== | Create a temporary directory instead of a file. | ||
<syntaxhighlight lang='bash'> | |||
mktemp -d | mktemp -d | ||
<syntaxhighlight lang='bash'> | |||
Revision as of 21:27, 17 February 2022
Internal
Overview
Create a uniquely named temporary file or directory and display its name at stdout.
local f=$(mktemp)
creates a /var/folders/t3/mmn20npx7fs31lwlp2s4_6wm0000gq/T/tmp.hbvowAQL file on Mac.
Who's responsibility is to delete it? It is deleted automatically?
Options
-d
Create a temporary directory instead of a file. <syntaxhighlight lang='bash'>
mktemp -d
<syntaxhighlight lang='bash'>