Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

mktemp

v(uutils coreutils) 0.8.0
mktemp [OPCIÓN]... [PLANTILLA]

Crear un archivo o directorio temporal.

Options

--directory, -d

Crear un directorio en lugar de un archivo

--dry-run, -u

no crear nada; simplemente imprimir un nombre (inseguro)

--quiet, -q

Fallar silenciosamente si ocurre un error.

--suffix=<SUFFIX>

agregar SUFIJO a PLANTILLA; SUFIJO no debe contener un separador de ruta. Esta opción está implícita si PLANTILLA no termina con X.

-p <DIR>

forma corta de –tmpdir

--tmpdir=<DIR>

interpretar PLANTILLA relativa a DIR; si DIR no se especifica, usar $TMPDIR ($TMP en windows) si está establecido, de lo contrario /tmp. Con esta opción, PLANTILLA no debe ser un nombre absoluto; a diferencia de -t, PLANTILLA puede contener barras, pero mktemp crea solo el componente final

-t

Generar una plantilla (usando el prefijo suministrado y TMPDIR (TMP en windows) si está establecido) para crear una plantilla de nombre de archivo [obsoleto]

Examples

Create an empty temporary file and print its absolute path:

mktemp

Use a custom directory if $TMPDIR is not set (the default is platform-dependent, but usually /tmp):

mktemp -p /{{path/to/temporary_directory}}

Use a custom path template (Xs are replaced with random alphanumeric characters):

mktemp {{/tmp/example.XXXXXXXX}}

Use a custom file name template:

mktemp -t {{example.XXXXXXXX}}

Create an empty temporary directory and print its absolute path:

mktemp -d

The examples are provided by the tldr-pages project under the CC BY 4.0 License.

Please note that, as uutils is a work in progress, some examples might fail.