Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
After installing numerous stuff on my Slackware system, I notice I am running out of hard-drive space. I see that /tmp/SBo has about 1G of staff that I recently installed --- may I safely delete this staff?
Sure you can. Maybe you'd like to save the .tgz packages for the future, but the /tmp/SBo folder you can remove - it's where the sources are unpacked and programs compiled and installed with DESTDIR. Take a look at some SlackBuild script and you'll see what are those.
Opinions vary about the best way to clean /tmp and none of them are guaranteed to cause no breakage. I remove everything in /tmp as soon as the file system containing it is mounted; this by modifying the boot script which mounts it; works for me; YMMV.
you say, "by modifying the boot script which mounts" /tmp. Which is the boot script you are referring to (is it /boot/config ?), and how did you modify it?
Yes you may! You can delete everything in /tmp if you really want to. Whatever the operating system actually requires the kernel will make again.
Ummm ... no, you can't, you shouldn't. Many apps, including X11,
have temporary files in /tmp for users CURRENT sessions. Deleting
those can make "bad things" happen. It's safe to delete OLD stuff
from /tmp, things that aren't currently being accessed.
On Slackware it's /etc/rc.d/rc.S. When /tmp is on the / file system, the relevant part is just after comment "# Remount the root file system in read-write mode" which is mostly an if-fi to deal with it failing. I use this line after the closing fi: ( cd /tmp && rm -rf -- * .* 2>/dev/null )
It's safe to delete OLD stuff
from /tmp, things that aren't currently being accessed.
+1 to all of Tinkster's post. Regards the quote above, the potential gotcha is that even old files and directories may be in use. This is a topic that has been much debated and, as I posted earlier, there are no guaranteed safe solutions. Prior discussions on LQ listed here.
I decided against that solution in favour of doing it during boot because rc.[06] runs rc.local_shutdown early so before shutting down many other things which _might_ depend on files+directories in /tmp including MySQL, Apache, Samba, NFS server, ssh (which does use /tmp), SASL, LDAP, D-bus, networked file systems, networking, process accounting, ACPI, quotas (which does use /tmp?) ...
I decided against that solution in favour of doing it during boot because rc.[06] runs rc.local_shutdown early so before shutting down many other things which _might_ depend on files+directories in /tmp including MySQL, Apache, Samba, NFS server, ssh (which does use /tmp), SASL, LDAP, D-bus, networked file systems, networking, process accounting, ACPI, quotas (which does use /tmp?) ...
I shy away from the .* wildcard because I've always though it'd expand to '..'. I tend to use .??* which forces the wildcard to expand to at least three characters (thereby omitting '..'). It still catches most dot-files: only those whose file name is fewer than three characters long don't get deleted. I have yet to come across such a file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.