Forrest logo
tool overview
On this page you find all important commands for the CLI tool mktemp. If the command you are looking for is missing please ask our AI.

mktemp

Mktemp is a command line tool commonly found in Unix-like operating systems. The name mktemp stands for "make temporary file". It is used for creating unique temporary files in a secure and convenient manner. The tool generates a safe filename by appending random characters to a given template. The template can be provided as an argument to the command or using the TMPDIR environment variable. Mktemp ensures that the generated filename is unique to avoid any accidental file overwrites. The temporary file created by mktemp is automatically deleted when the program exits. The tool is often used by shell scripts and other programs that require temporary file creation. Mktemp provides options to customize various aspects of the generated filename, such as specifying the prefix, suffix, and directory location. It is a useful utility that simplifies the management of temporary files in command line operations.

List of commands for mktemp:

  • mktemp:tldr:1979b mktemp: Create a temporary directory and print the absolute path to it.
    $ mktemp --directory
    try on your machine
    explain this command
  • mktemp:tldr:50f7d mktemp: Create an empty temporary file and print the absolute path to it.
    $ mktemp
    try on your machine
    explain this command
  • mktemp:tldr:5cdf0 mktemp: Create a temporary directory and print the absolute path to it.
    $ mktemp -d
    try on your machine
    explain this command
  • mktemp:tldr:a061b mktemp: Create an empty temporary file with a given suffix and print the absolute path to file.
    $ mktemp --suffix "${-ext}"
    try on your machine
    explain this command
tool overview