I want to clean my hard disk

James Wilkinson james at westexe.demon.co.uk
Sun Sep 26 20:58:13 UTC 2004


Alexander Dalloz recommended:
> For the "cleaning" topic see my first comments. If you have need then
> make use of the command "find" in conjunction with "rm".

Can I recommend that you use find in conjunction with "echo rm" until
you're *sure* you know what's going to happen?

Find and rm together are a very powerful combination. In the same way
that stupidity, high explosives, and a battle tank are a very powerful
combination. If you're not careful, you could get badly hurt...

Since the subject is finding files in /tmp: ALWAYS use the -xdev option
to find when you're finding files to delete in /tmp, ESPECIALLY if
you're going to script this.

Especially on other Unices, it is common to create a temporary
mount-point in /tmp if one wants to temporarily mount another
filesystem (say a floppy, or an NFS mount from another server). This
practice gets written into scripts and programs, and you may not realise
that what you're running is doing this.

You should be able to see what's coming. Someone NFS mounts the root
directory of another server under /tmp, forgets about it, and the find
in the automatic /tmp cleaning script procedes to "clean" all the
kernels off the other server. Then someone reboots...

No, I haven't been bitten: I use -xdev. Oh, and man tmpwatch says
"tmpwatch ... will not switch filesystems". So that's all right.

James.
-- 
E-mail address: james | Og just boggle how stupid spammer is. How stupid
@westexe.demon.co.uk  | spamhaus is. How stupid spamhaven is. Og thought
                      | there was such thing as "evolution". How all these
                      | stupid people still alive? Og boggle. Boggle Og.
                      |     -- Caveman Og





More information about the fedora-list mailing list