[techtalk] core file

Magni Onsoien magnio at pvv.ntnu.no
Sun Jun 4 18:58:58 EST 2000


steph:

> =  find / -name core -exec rm {} \;
> = then executes a rm command for each one found.

[...]

> Also, in a discussion I had last week about putting SID names
> into the .dbf files of Oracle databases, one of my colleagues
> told me a horror story where part of the SID was called
> 'core' which led to the database being wiped out when the above
> command was run.  

Unless you use *core* or something like thati (i.e. with wildchars), that 
shouldn't happen. find (well, at least GNU find) will look for a file or a 
directory with the exact name 'core'.
(Sorry if I misunderstood you and that what you mean is that the complete 
name of the db was just 'core'. then it will of course match.)

As a precaution it might be wise to add '-type f ! -type l' to the above
find-command, then you won't delete a directory called core (it only
matches files) or a symbolic link ( not -type l) pointing to fex 
/dev/null (I have seen both. The latter is actually quite smart, nice 
to use if you want to get rid of all core-files from  netscape and emacs 
and all those other programmes that you start from the root of your home 
dir (i.e. where most people are when they just open an xterm), while you 
want to keep core files from testing of your programmes which are put in 
other directories.)


Magni :)
-- 
ulimit is good for you.





More information about the Techtalk mailing list