0

I'm running Centos6 and inside mt /tmp/ folder I see these files

drwxr-xr-x.  2 root root       4096 Jan 14  2016 fileinstall-1059639640221211034
drwxr-xr-x.  2 root root       4096 Jan 30  2021 fileinstall--1088700727245300865
drwxr-xr-x.  2 root root       4096 May  8  2021 fileinstall-1103275592857423187
drwxr-xr-x.  2 root root       4096 Nov 27  2013 fileinstall--1136663737066394217
drwxr-xr-x.  2 root root       4096 Oct 29  2013 fileinstall--1159993482611477590
drwxr-xr-x.  2 root root       4096 Sep 20  2015 fileinstall--1179645354920264553
drwxr-xr-x.  2 root root       4096 Oct 31  2014 fileinstall-122712582343751236
drwxr-xr-x.  2 root root       4096 May  6  2019 fileinstall--1421070942165881283
drwxr-xr-x.  2 root root       4096 Feb 20  2021 fileinstall--1778997120093675509
drwxr-xr-x.  2 root root       4096 Sep 30  2021 fileinstall-1853904966015687965
drwxr-xr-x.  2 root root       4096 Feb  2  2021 fileinstall--204359382451416977
drwxr-xr-x.  2 root root       4096 Nov 30  2021 fileinstall--2063084550731465366
drwxr-xr-x.  2 root root       4096 Jan 28  2021 fileinstall--2089002648208375729
drwxr-xr-x.  2 root root       4096 Oct 24  2013 fileinstall-2187331466680579249
drwxr-xr-x.  2 root root       4096 Oct 22  2013 fileinstall--2590570383770241952
drwxr-xr-x.  2 root root       4096 Jul 29  2016 fileinstall-2819564663497542969
drwxr-xr-x.  2 root root       4096 Nov  5  2021 fileinstall-2835020095656193300
drwxr-xr-x.  2 root root       4096 Sep 17  2014 fileinstall-2943946855848024991
drwxr-xr-x.  2 root root       4096 May  8  2021 fileinstall-3055010024006600680
drwxr-xr-x.  2 root root       4096 Nov  7  2014 fileinstall-3158184956014033312
drwxr-xr-x.  2 root root       4096 Oct 22  2013 fileinstall--3224061972261049326
drwxr--r--.  2 root root       4096 Jun 27  2019 tmp00000e8b
drwx------.  2 root root       4096 Dec 16  2021 tmp.A3Q7aY7gYr
drwxr-xr-x.  2 root root       4096 Oct 29  2013 vmware-config0
drwxr-xr-x.  2 root root       4096 Jan 25  2016 vmware-config1
drwxr-xr-x.  2 root root       4096 Oct 29  2013 vmware-fonts0
drwxr-xr-x.  2 root root       4096 Jan 25  2016 vmware-fonts1
drwxr--r--.  2 root root       4096 Jan 14  2021 vmware-root
drwx------.  2 root root       4096 Oct  4 06:27 vmware-root-4282170909
-rw-r--r--.  1 root root          0 Oct 18  2013 yum.log
-rw-r--r--.  1 root root      97065 Jan 25  2016 yum_save_tx-2016-01-25-09-57NLmfCx.yumtx

I was wondering if I could delete those files or how can I know if I can delete them?

1 Answers1

2

The /tmp directory is meant for temporary files. Programs creating files there should not rely on those files remaining there indefinitely. So it is generally safe to delete them. You should however make sure the program which created the file isn't still running. Otherwise it might react ungraciously to the removal.

The safest approach is to clean out the /tmp directory during system shutdown. Indeed, many Linux distributions make /tmp a RAM disk, so it is automatically emptied in a shutdown. CentOS 6 is not among those, though, so you'll have to set up something yourself.

Tilman Schmidt
  • 4,101
  • 12
  • 27
  • Typically, I'd remove "old" files. Of course, "old" is relative. – hans_meine Oct 04 '22 at 13:15
  • If you reboot the server is the same as a shutdown and restart? I was wondering because I ran a `reboot` command and nothing really happen on the `/tmp/` folder. So, maybe what I need is to shutdown the server and boot it up again? Thanks. – fanpero87 Oct 04 '22 at 18:21
  • It won't happen by itself. My suggestion was to configure a shutdown action which will clean out the `/tmp` folder during shutdown. In hindsight I see my answer could have been interpreted in that direction so I amended it a bit. – Tilman Schmidt Oct 04 '22 at 21:51