語法:
mktemp [OPTION]... [TEMPLATE] 安全
Create a temporary file or directory, safely, and print its name.
TEMPLATE must contain at least 3 consecutive 'X's in last component.
If TEMPLATE is not specified, use tmp.XXXXXXXXXX, and --tmpdir is implied.
Files are created u+rw, and directories u+rwx, minus umask restrictions.app
安全的建立臨時文件或目錄並輸出建立的文件名.
若是須要指定最後部分的[TEMPLATE],它必須包含至少3個連續的X字符
若是沒有指定[TEMPLATE] ,則默認使用tmp.XXXXXXXXXX (連續10個X字符)
建立的臨時文件和目錄默認在/tmp下
經過mktemp命令建立的臨時文件的默認權限爲u+rw,臨時目錄權限爲u+rwxide
-d, --directory
create a directory, not a file
//建立一個目錄
-u, --dry-run
do not create anything; merely print a name (unsafe)
//僅打印文件名不建立任何文件或目錄ui
-q, --quiet
suppress diagnostics about file/dir-creation failurethis
--suffix=SUFF
append SUFF to TEMPLATE; SUFF must not contain a slash. This
option is implied if TEMPLATE does not end in X
//指定TEMPLATE的後綴名,不能包含斜線.
//也能夠直接加上除X字符之外的任意字符後綴做爲TEMPLATE,二者等效rest
-p DIR, --tmpdir[=DIR]
interpret TEMPLATE relative to DIR; if DIR is not specified, use
$TMPDIR if set, else /tmp. With this option, TEMPLATE must not
be an absolute name; unlike with -t, TEMPLATE may contain
slashes, but mktemp creates only the final componentcomponent
//指定要建立的臨時文件的路徑,不指定則爲/tmp.
//TEMPLATE能夠包含路徑.但指定了DIR後,TEMPLATE不能再包含絕對路徑orm
-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] //官方已不同意使用ci
--help display this help and exitit
--version output version information and exit