Even better than
/tmp are the
tmpfs volumes. These behave like real filesystems but are actually "RAM drives". They offer :
- read, write and delete is really fast
- purged at power off and unmount
Distributions (at least Debian does it) usually set up one (or more) for you. List them with :
mount | grep tmpfs
df -h | grep tmpfs
which also shows the available space.
/dev/shm is my favorite candidate.
as said in a comment :
writing to tmpfs files will still fill up your memory and swap.
Which is totally right. The
tmpfs volumes, like all other volumes, are not a kind of "magical" area where you can store data without limits. They have a defined size (which is reported by the
df ... command above) and filling them up may end up slowing your computer (I say "may" rather than "will" because I've actually never experienced this : never had to write more than a few MB of disposable data).