O'Reilly logo

Linux in a Nutshell, 6th Edition by Robert Love, Stephen Figgins, Ellen Siever, Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

mktemp

Synopsis

mktemp [options] [template]

Generate a unique temporary filename for use in a script. The filename is based on the specified template, which may be any filename with at least six Xs appended (e.g., /tmp/mytemp.XXXXXX). mktemp replaces the Xs with the current process number and/or a unique letter combination. The file is created with mode 0600 (unless -u is specified), and the filename is written to standard output. With no template specified, the default file tmp.XXXXXXXXXX is created.

Options

-d, --directory

Make a directory, not a file.

--help

Print usage information and exit.

-q, --quiet

Fail silently in case of error. Useful to prevent error output from being sent to standard error.

-u, --dryrun

Operate in “unsafe” mode and unlink the temporary file before mktemp exits. Use of this option is not recommended.

-V, --version

Print version information and exit.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required