Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 05-31-2003, 08:28 PM   #1
Registered: May 2003
Location: Mt. Prospect, Illinois
Distribution: Fedora Core 2, SuSE 9.1 Professional
Posts: 189

Rep: Reputation: 30
/tmp directory


I am still new to Linux and with a really stupid question, I think. I am aware that in my Red Hat 9 system CRON is being forced by ANACRON to run several maintenance functions and can read them in the crontab file with no problem. I also am aware that there is a program that runs now and then (maybe) called tmpwatch.

My question is about the /tmp directory. How safe is it to empty stuff out of there? I would only do it after a fresh reboot. There is one directory in there called /tmp/orbit/"my user account" that has a gagillion 0KB files. Now, I don't think I have a problem clearning that out now and then, but want to make sure first.

So the bottom line question is this, and I'm really sorry if others have been on the posts with the (I can't find it)...CAN I DELETE ALL OF THE STUFF IN THE /tmp DIRECTORY or should I just leave it alone?

Old 05-31-2003, 08:41 PM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 266Reputation: 266Reputation: 266
You can safely remove all files in /tmp

At times its best to remove them like you said after a fresh reboot or put a small script to clear out the directory in your startup scripts.
Old 06-01-2003, 02:51 AM   #3
Senior Member
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
I would rather say add a tmp cleanup script to your cron.daily. Like you could use:

# clean up /tmp and /var/tmp

if [ -d /tmp -a -d /var/tmp ]
        find /tmp -type f -atime +3 -exec rm {} \;
        find /var/tmp -type f -atime +3 -exec rm {} \;
This will remove files in /tmp and /var/tmp that haven't been accessed in 4 (3+1) days.
1 members found this post helpful.
Old 06-01-2003, 04:32 PM   #4
Registered: May 2003
Location: Mt. Prospect, Illinois
Distribution: Fedora Core 2, SuSE 9.1 Professional
Posts: 189

Original Poster
Rep: Reputation: 30
Thanks all...

I will take your advice....right now, I don't have a problem manually cleaning every now and then as I am interested in just kind of monitoring what goes on in there.

But I might run that script for later...or look at my CRONTAB to see what might be modified to get it to clean it more often. However, I'm not adverse to doing it manually.

I am having fun in Linux and leaned a lot today installing Java and doing some CD burning with CDroast...a pretty robust program if you ask me...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
/tmp directory is full? Moses420ca Linux - Newbie 13 01-21-2005 07:48 PM
tmp directory being deleted jpokrzyk Linux - General 3 10-30-2004 06:42 PM
Can I delete everything in the /tmp directory? BajaNick Linux - General 5 07-04-2004 01:35 PM
permissions in /tmp directory linux_pioneer Linux - Software 1 08-30-2003 10:43 PM
/tmp directory too small??? kazi Linux - Newbie 9 03-29-2003 12:46 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:00 PM.

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