Ask Your Question

Differences between tmp folders

asked 2016-04-20 22:12:34 -0600

gobigobi66 gravatar image

updated 2016-04-20 22:13:38 -0600

I'd like to know more about the differences and purposes of all the tmp directories I can find on my Fedora system. Which program uses which tmp folder?

  • /tmp
  • /usr/tmp (links to /var/tmp)
  • /var/tmp

and there is more...

  • /run/tmpfiles.d
  • /etc/tmpfiles.d
  • /usr/lib/tmpfiles.d
  • /var/lib/selinux/tmp
  • /var/spool/cups/tmp (ok, that's maybe some printer related temp data. I accept) -...

What are all these?

Do you recommend locating more than just /tmp into RAM? (here is my fstab:

none on /tmp type tmpfs (rw,relatime,seclabel,size=399352k)


edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2016-04-21 08:26:30 -0600

Pilgrim gravatar image

/tmp may be, and sometimes is, cleaned on reboot.

/var/tmp is preserved between reboots.

/usr/tmp links to /var/tmp for compatibility with some programs.

/run is used for programs running at the moment and should be purged as the program finished

/etc/tmpfiles.d contains settings for creating the said temporary files and can be changed by user on a per-machine basis

/usr/lib/tmpfiles.d is the default configuration settings folder for said tmp files generation rules, that are provided with the packages

/var/lib/selinux/tmp holds temporary files for SELinux software. If you're really interested, you can read the documentation to find out what exactly is stored in there.

edit flag offensive delete link more

answered 2016-04-21 12:08:11 -0600

cmurf gravatar image

Clarification. By default for some time on Fedora, tmpfs is mounted on /tmp so it definitely is cleaned between reboots. /var/tmp gets cleaned out regularly by systemd-tmpfiles-clean.service.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-04-20 22:12:34 -0600

Seen: 524 times

Last updated: Apr 21 '16