Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If you are running X you don't wanna delete your lock files; also KDE puts some files in there if you are running it that you don't want to delete unless you stop running it (just for that session). If you are about to reboot, I do believe you can, but I'd be weary of doing it. If you are looking for some space saving use:
du -h
And find the biggest "byte thief" and remove it/them.
You should just place a command to clean out and remove everything in /tmp in your startup scripts. Or you can usually log out of X and then remove everything safely.
Distribution: Slackware 10, Fedora Core 3, Mac OS X
Posts: 617
Rep:
I'd be wary of doing while you're logged in at all. You can have a script, either at boot or shutdown, to clear it out but there is really not much point in doing it any other time. Many of the files there are important to running programs (even ones that aren't X programs). However, a running program that has created a lock file should clear it out once its finished. If it doesn't then its a "stale lock" and is usually safe to delete at shutdown or startup.
Basically you should be ok to remove any contents in /tmp while logged out of X and not running many programs in the background. I personally have done this numerous times but yet my system could differ from yours so don't hold me reliable if something goes wrong.
The safest bet is to setup a script to remove while shutting down or booting up to clear it out like I mentioned the first time.
Distribution: Slackware 10, Fedora Core 3, Mac OS X
Posts: 617
Rep:
Code:
rm -rf /tmp/*
That in one of your startup scripts should do the job but be very careful with it. And if its in the startup scripts then make sure that its one of the first things to be run before any progs attempt to make use of /tmp
Oh and about the rc.local, I wouldn't place that there, that is usually loaded last or towards the end. You'd want to place the command in one of the other startup scripts that run earlier. I'm not familiar with Redhat's startup scripts now but like on my Slack box I would place it somewhere in my rc.M script in which I use to boot into runlevel 3, multiuser mode.
Distribution: Slackware 10, Fedora Core 3, Mac OS X
Posts: 617
Rep:
I'm afraid I don't use Red Hat (and neither does TrickyKid last time I was here) but the rc.local is probably not the best one to choose since its the last one to be run. You'd have to check the documentation for red hat (they have a book online which I found by searching www.google.co.uk/linux for init scripts red hat ).
That should get you sorted
Alex
{*dammit someone always posts before me saying exactly what I was going to say *}
Distribution: Slackware 10, Fedora Core 3, Mac OS X
Posts: 617
Rep:
Quote:
I'm a freak that is bored at work as well.
Yes you told me that all those years ago when we started at this forum and I asked you whether you actually ever did any work (since you always answered posts before I got near them ).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.