[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: removing the core file...



I don't know too much shell programming so can anyone make a shell script
which runs a file command on the core file to check whether a file named
core is actually a core dump and then delete it. That way, you don't delete
files that are just named core and not really core.

Akshat


>You can make the script shorter (and more accurate) with:
>
> find . -type f -name core | xargs rm -f
>
>The -type f ensures that you don't remove any devices and/or
>directories named core by mistake (yes, some Unix's do have devices
>named core, and the Linux kernel has a subdirectory called core).
>
>-- Raju



- --------------------------------------------------------------------
For more information on Linux in India visit http://www.linux-india.org/
The Linux India mailing list does not accept postings in HTML format.

------------------------------