A temporary file created by mktemp for use by shell scripts.
Syntax
Mktemp [-qu] [file name parameters]
Parameters:
-If an error occurs during q & A execution, no information is displayed.
-U branch temporary files will be deleted before mktemp ends.
[File name parameter] the parameters of the custom file name must be in the format of "custom name. XXXXXX.
Instance
When you use the mktemp command to generate a temporary file, the file name parameter should be given in the form of "file name. XXXX". 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 a 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 a temporary file cmd @ cmd-desktop :~ $ Dir # view the current directory file test testfile testfile1 tmp.3847 # tmp.3847 is generated
The generated temporary file is tmp.3847, where "XXXX" in the file name parameter is replaced by four randomly generated characters.