Questions tagged [tmp]

171 questions
43
votes
3 answers

is /tmp guaranteed to exist?

Do I need to check & create /tmp before writing to a file inside of it? Assume that no one has run sudo rm -rf /tmp because that's a very rare case
Ayush
  • 4,867
34
votes
6 answers

Is it safe to rm -rf /tmp/*?

This is something I used to do a lot on Windows, but after my recent fiasco I want to make sure. Is it safe to do sudo rm -rf /tmp/* ?
ripper234
  • 31,763
19
votes
3 answers

Generic way to get temp path?

I heard about $TEMP and $TMP, but I think they are not standard for every distro. As far as I know, the best way to get the temp dir is just /tmp, is there any distro that won't work using that path?
12
votes
4 answers

Prevent a directory in /tmp from being deleted

I often use the /tmp directory on my Linux machine for storing temporary files (e.g. PDFs from a site that wants me to download it first etc.) and I often create a directory with my username. But at every startup it (including all files) gets…
ummw
  • 345
3
votes
1 answer

Where can users create temporary files safely?

Once /tmp ideally should be reserved for the system, where can a user create temporary files safely?
2
votes
1 answer

Small RAM-based /tmp

My VPS host's web interface for configuration gives me a dropdown box to set my /tmp. The default is "16MB RAM" and the alternative is "harddisk". Is it possible that having only 16MB of /tmp available could cause trouble for some software? Or not?
themirror
  • 6,988
1
vote
1 answer

Create a persistent temp directory with temporary content

I wish to create a directory in $TMP_DIR or /tmp/ which persists forever (i.e. is never deleted) but it is maintained by OS, i.e. the content of which can be deleted if they have not been opened/used in a while or system needs more…
user14492
  • 853
0
votes
1 answer

Shred files in tmpfiles.d

After searching the tmpfiles.d, its seems like there is a limited number of option to erase the files/directories. I want to totally erase the temporary directories with a shred like command, is there a way to trigger a script in the tmpfiles.d…
Jaay
  • 145
0
votes
1 answer

How to set up /var/tmp

This is a very stupid question but how can we set up /var/tmp? Is there a special way to do it or will just creating the directory suffice?
0
votes
0 answers

MX-21 /tmp directory empty on reboot

I am using MX-21 and my /tmp directory is getting purged on every reboot. I would like to keep my /tmp for a week, so after some searching the web I modified the /etc/tmpfiles.d/tmp.conf file and added this line d /tmp 0755 root root 7d and it's…