Sponsored Content
Operating Systems Linux Red Hat Can all files under /tmp be safely removed Post 302886391 by wisecracker on Friday 31st of January 2014 06:37:12 AM
Old 01-31-2014
As an addendum to vbe's reply...

Short answer - No!

If however you know EXACTLY what the temporary files are, and, are for, then you can
delete those particular temporary files at your leisure.
This User Gave Thanks to wisecracker For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Bring back removed files

Dear People I have removed some of my files and directories( by using rm and rmdir commands) by mistake. I wish to bring them back. How is it possible?( I am using solaris 2.6) best regards Reza Nazarian:( (2 Replies)
Discussion started by: Reza Nazarian
2 Replies

2. UNIX for Dummies Questions & Answers

monitoring /tmp and /var/tmp for suspicous activity

Hello, does anyone have a script that can check the contents of the /tmp directory and for example e-mail the directory content if anything other than session files are present? Maybe there are better ways to monitor suspicous /tmp and /var/tmp activity, if so I'm listening :) (1 Reply)
Discussion started by: jamesbond
1 Replies

3. UNIX for Dummies Questions & Answers

Will Old Files Be Removed

I have windows Xp installed, and decided to install Solaris Sun Unix 10. The hard disk was previousely partitioned into 5 partition. C: = Win98 D = WinXP and e,f,g,h are applications and so on. When istalling Sun Unix, will all the drives be removed, or I will specify where to install it. Thanks... (5 Replies)
Discussion started by: sunsation
5 Replies

4. Solaris

after init all /tmp file has been removed

I'm new in Solaris server After the system support reboot the Solaris server, all the files in /tmp has been removed, is that normal under Solaris or under different init level will get different result? which init level will do that? (5 Replies)
Discussion started by: yesthomas
5 Replies

5. UNIX for Dummies Questions & Answers

recovering files removed with rm

Hello, I was reading the manual on rm and it states that when you use 'rm' the files are usual recoverable, how is this done? Does it assume that a backup system is in place? Cheers Jack (4 Replies)
Discussion started by: jack1981
4 Replies

6. Solaris

How to safely copy full filesystems with large files (10Gb files)

Hello everyone. Need some help copying a filesystem. The situation is this: I have an oracle DB mounted on /u01 and need to copy it to /u02. /u01 is 500 Gb and /u02 is 300 Gb. The size used on /u01 is 187 Gb. This is running on solaris 9 and both filesystems are UFS. I have tried to do it using:... (14 Replies)
Discussion started by: dragonov7
14 Replies

7. Shell Programming and Scripting

How to safely rm/mv files/directory

Hi all, Am writing a script that does a rm/mv if a file exist, however, in one scenario, one of the variables which is supposed to a variable for a directory is undefined/blank so instead of the variable resolving to /tmp/logfile.dmp, it resolves instead to / so the rm translates to a rm /... (2 Replies)
Discussion started by: newbie_01
2 Replies

8. Shell Programming and Scripting

Merging few files into one, duplicates are removed

Hello, I have few file such as below: abc.txt def.txt ghi.txt jkl.txt n.txt I would like to merge all these files together into one file. At the same time, any duplicates will be removed. (5 Replies)
Discussion started by: alegnagrp
5 Replies

9. Shell Programming and Scripting

Safely Remove Files with Special Chars

Hey Guys, I'm swamped writing code for the forums: Could someone write a script or command line to safely delete files with special chars in filenames from a directory: Example: -rw-r--r-- 1 root root 148 Apr 30 23:00 ?xA?? -rw-r--r-- 1 root root 148... (8 Replies)
Discussion started by: Neo
8 Replies
TEMPNAM(3)								 1								TEMPNAM(3)

tempnam - Create file with unique file name

SYNOPSIS
string tempnam (string $dir, string $prefix) DESCRIPTION
Creates a file with a unique filename, with access permission set to 0600, in the specified directory. If the directory does not exist or is not writable, tempnam(3) may generate a file in the system's temporary directory, and return the full path to that file, including its name. PARAMETERS
o $dir - The directory where the temporary filename will be created. o $prefix - The prefix of the generated temporary filename. Note Windows uses only the first three characters of prefix. RETURN VALUES
Returns the new temporary filename (with path), or FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 4.0.3 | | | | | | | This function's behavior changed in 4.0.3. The | | | temporary file is also created to avoid a race | | | condition where the file might appear in the | | | filesystem between the time the string was gener- | | | ated and before the script gets around to creat- | | | ing the file. Note, that you need to remove the | | | file in case you need it no more, it is not done | | | automatically. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 tempnam(3) example <?php $tmpfname = tempnam("/tmp", "FOO"); $handle = fopen($tmpfname, "w"); fwrite($handle, "writing to tempfile"); fclose($handle); // do here something unlink($tmpfname); ?> NOTES
Note If PHP cannot create a file in the specified $dir parameter, it falls back on the system default. On NTFS this also happens if the specified $dir contains more than 65534 files. SEE ALSO
tmpfile(3), sys_get_temp_dir(3), unlink(3). PHP Documentation Group TEMPNAM(3)
All times are GMT -4. The time now is 07:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy