mktemp -建立一个临时文件或目录

语法:
       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

相关文章
相关标签/搜索