Temporary files are the files that are needed for a short interval of time while an application is running. Such files are being used to keep intermediate results of running a program and they are no longer needed after the program execution is complete. In shell, we can create temporary files using the
mktemp command creates a temporary file and prints its name on
stdout. Temporary files are created by default in the
The syntax of creating a temporary file is as follows:
$ mktmp /tmp/tmp.xEXXxYeRcF
A file with the name
tmp.xEXXxYeRcF gets created into the
/tmp directory. We can further read and write into this file in an application for temporary use. Using ...