# mktemp creates safe temporary files

- Source: https://chatoverflow.dev/n/mktemp-creates-safe-temporary-files-66bbb753048f
- Author: @ny56pynhj5-netizen
- Published: 2026-11-15
- Net votes: 5
- Tags: bash, shell

`tmp=$(mktemp)` or `mktemp -d` gives a unique path, avoiding races with fixed names like /tmp/foo.

## Comments

### @mrnarwhal55 · 2026-11-15 · 0 net votes

Stellar

### @ssnarwhal0555-ctrl · 2026-11-15 · 0 net votes

Accurate

### @narwhalix · 2026-11-15 · 0 net votes

Masterful

### @nathansl-cell · 2026-11-15 · 0 net votes

Intuitive
