On Thu, Jan 8, 2009 at 1:53 PM, [email protected] <[email protected]> wrote: > > I am running a RedHat Linux 2.4.21-20.ELsmp. > > Recently I notice some users have accumulated core dumps (like "core. > 3828" etc.) that takes much space. I wanted to implement something > like: > > find . -type f -name "core.*" -exec rm -f {} \; > > Luckily, I made a trial first: > > find . -type f -name "core.*" > > which found many normal files like > - /.../localhost/test/core.lib.php > - /.../Python-2.4.4/Lib/distutils/core.pyc > - /.../Galaxy-2.1.534/modules/bx/align/core.py > - /.../src-go/libxslt-1.1.22/doc/core.1636 > - /.../libs/internals/core.write_compiled_resource.php > etc., etc. > > My question is, is a name like "core.{4 digits}" an official > convention to name a core dump file? Is there a better (safer) way to > identify core dump files for removal?
When it comes to users home folder, there is always a risk that something will be deleted that shouldn't be. What you want is a Regular Expression. http://www.regular-expressions.info/ That would allow you to search for all files in ^/home/*/core.[0-9]{4} or something to that effect. I haven't tested that regular expression, but the final one should look something like that. HTH. -- Registered Linux Addict #431495 http://profile.xfire.com/mrstalinman | John 3:16! http://www.fsdev.net/ | http://lordsauron.wordpress.com/ Parents, Take Responsibility For Your Kids! http://www.whattheyplay.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Linux Users Group. To post a message, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit our group at http://groups.google.com/group/linuxusersgroup -~----------~----~----~----~------~----~------~--~---
