LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-14-2003, 09:24 AM   #1
coolamit78
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RHEL AS 3/4, Windows XP
Posts: 546

Rep: Reputation: 31
Removing Temporary Files


I have Redhat 8.0 with KDE.

I read somewhere that as a Linux user, one must keep an eye on the size of temporary files building inside the root directory.

I noticed that there are 2 directories that store temporary files -

/tmp and /var/tmp

My question is -

Do the /tmp and /var/tmp contain important data?

or Will it be safe to delete the entire contents of these two directories like the c:\temp and c:\windows\temp directories under MS Windows?

Please clarify.
 
Old 09-14-2003, 10:23 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
It is safe to remove temporary files from your tmp directorys.

Most will have these dumped or removed at boot time. It's sometimes safer though to remove them while not in X, as if your in X and remove the files, you might remove something important then, like an application open, etc.
 
Old 09-15-2003, 04:22 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
There's apps like "tmpwatch" to help you automagically remove "old" tempfiles 'n stuff.
 
Old 09-16-2003, 04:26 PM   #4
gbell72
Member
 
Registered: Sep 2003
Location: Toronto, Canada
Distribution: FreeBSD
Posts: 78

Rep: Reputation: 15
You could also set yourself up some cron jobs like this instead of having to download and install a new app:
0 3 * * * /usr/bin/find /tmp -atime +7 \
-exec /bin/rm -rf {} \; 2> /dev/null

0 3 * * * /usr/bin/find /var/temp -atime +7 \
-exec /bin/rm -f {} \; 2> /dev/null

Last edited by gbell72; 09-16-2003 at 04:32 PM.
 
Old 09-17-2003, 03:22 PM   #5
Jeff Foster
LQ Newbie
 
Registered: Sep 2003
Location: Linden, TN
Distribution: Suse 8.1
Posts: 19

Rep: Reputation: 0
Aren't those removed by the "make clean" command?
 
Old 09-17-2003, 03:40 PM   #6
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Quote:
Originally posted by Jeff Foster
Aren't those removed by the "make clean" command?
No, 'make clean' usually removes all .o and such from the directories you compile a program. I don't remember any Makefile that deletes something in /tmp.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing temporary files joe-uncle Linux - Newbie 3 10-29-2004 11:51 AM
Temporary Internet Files?????????? RobTek Linux - Newbie 12 10-25-2004 07:20 PM
crontab & quota files are temporary files? hamish Linux - Software 0 07-10-2004 02:09 PM
Temporary Files Full? Killer7 Linux - Software 8 02-07-2004 04:27 PM
Internet Temporary Files jnutty3 Linux - General 4 10-27-2001 11:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration