{"id":911,"date":"2019-04-22T23:35:22","date_gmt":"2019-04-22T15:35:22","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=911"},"modified":"2019-04-22T23:35:23","modified_gmt":"2019-04-22T15:35:23","slug":"mktemp","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/mktemp","title":{"rendered":"mktemp\u547d\u4ee4 – \u5efa\u7acb\u6682\u5b58\u6587\u4ef6"},"content":{"rendered":"\n

mktemp\u7528\u6765\u5efa\u7acb\u6682\u5b58\u6587\u4ef6\uff0c\u5176\u521b\u5efa\u7684\u4e34\u65f6\u6587\u4ef6\u662f\u552f\u4e00\u7684 \uff0c\u4f9bshell \u4f7f\u7528 \u3002<\/p>\n\n\n\n

\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cmktemp\u4f1a\u5728\u672c\u5730\u5f53\u524d\u76ee\u5f55\u521b\u5efa\u4e00\u4e2a\u4e34\u65f6\u6587\u4ef6\uff0c\u521b\u5efa\u4e34\u65f6\u6587\u4ef6\u65f6\u53ea\u9700\u8981\u521b\u5efa\u6a21\u677f\u6587\u4ef6\uff0c\u6a21\u677f\u53ef\u4ee5\u5305\u542b\u4efb\u610f\u7684\u6587\u4ef6\u540d\uff0c\u6587\u4ef6\u672b\u5c3e\u53ef\u4ee5\u6839\u636e\u9700\u8981\u6dfb\u52a0n\u4e2ax\u3002 <\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>mktemp [\u53c2\u6570] [\u6587\u4ef6] <\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n
-q  <\/td>\u6267\u884c\u65f6\u82e5\u53d1\u751f\u9519\u8bef\uff0c\u4e0d\u4f1a\u663e\u793a\u4efb\u4f55\u4fe1\u606f<\/td><\/tr>
-u <\/td>\u6682\u5b58\u6587\u4ef6\u4f1a\u5728mktemp\u7ed3\u675f\u524d\u5148\u884c\u5220\u9664<\/td><\/tr><\/tbody><\/table>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b:<\/strong><\/p>\n\n\n\n

\u751f\u6210\u4e34\u65f6\u6587\u4ef6\uff0c\u6587\u4ef6\u540d\u53c2\u6570\u5e94\u5f53\u4ee5”\u6587\u4ef6\u540d.XXXX”\u7684\u5f62\u5f0f\u7ed9\u51fa \uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# mktemp tmp.xxxx <\/pre>\n\n\n\n

\u751f\u6210\u4e34\u65f6\u76ee\u5f55\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# mktemp -d<\/pre>\n\n\n\n

\u5728\u6307\u5b9a\u76ee\u5f55\u4e0b\u751f\u6210\u4e34\u65f6\u6587\u4ef6\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# mktemp -d --tmpdir=\/home abc.XXX <\/pre>\n\n\n\n

\u81ea\u5b9a\u4e49\u6587\u4ef6\u6a21\u677f\uff0c\u5e76\u4e14\u751f\u6210\u5728\u7cfb\u7edf\u76ee\u5f55\u4e0b\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# mktemp -t abc.XXXXXX <\/pre>\n\n\n\n

\u81ea\u5b9a\u4e49\u6587\u4ef6\u6a21\u677f\uff0c\u5e76\u4e14\u751f\u6210\u5728\u7cfb\u7edf\u76ee\u5f55\u4e0b\uff0c \u6267\u884c\u65f6\u82e5\u53d1\u751f\u9519\u8bef\uff0c\u4e0d\u4f1a\u663e\u793a\u4efb\u4f55\u4fe1\u606f \uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# mktemp -t -q abc.XXXXXX<\/pre>\n","protected":false},"excerpt":{"rendered":"

mktemp\u7528\u6765\u5efa\u7acb\u6682\u5b58\u6587\u4ef6\uff0c\u5176\u521b\u5efa\u7684\u4e34\u65f6\u6587\u4ef6\u662f\u552f\u4e00\u7684 \uff0c\u4f9bshell \u4f7f\u7528 \u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cmktemp\u4f1a\u5728 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/911"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=911"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/911\/revisions"}],"predecessor-version":[{"id":941,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/911\/revisions\/941"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}