English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Linux mktemp command is used to create temporary files.
A temporary file created by mktemp, for use in shell scripts.
mktemp [-qu][File name parameter]
Parameter:
When generating a temporary file using the mktemp command, the file name parameter should be given in the form of "file name.XXXX", and mktemp will create a temporary file based on the file name parameter. Enter the following command at the command line prompt:
mktemp tmp.xxxx #Generate temporary file
After using this command, you can use dir or ls to view the current directory and get the following results:
cmd@cmd-desktop:~$ mktemp tmp.xxxx #Generate temporary file cmd@cmd-desktop:~$dir #View the current directory file test testfile testfile1 tmp.3847 #Generated tmp.3847
As can be seen, the generated temporary file is tmp.3847Among them, the file name parameter "XXXX" is replaced by4 replaced by a randomly generated character.