[Solved] Deleting a all core files present in file systems ?

Hi All

IN HPUX 11

How to delete an unwanted "core" file with a single command
which is being generated in different locations of the system

the command should be able to free up the space occupied by all "core" file
which is present in different folders and filesytems in a system

i tried echo ".">core which frees up the space occupied by core in present folder.

When i find for term "core" i get files and folders named "core"

Suggest command which should only delete the files with name "core"

Thanks in Advance

Hello,

find / -name core -exec rm -f {} \;

will find all "core's" on the system and delete them.

Regards

Be careful. There are files and directories called "core" on most unix systems (including HP-UX) which are not "core files".

This is dangerous.

To get a list of files which are definitely core files.

find // -type f -name core -exec file {} \;|grep "core file from"|awk -F: '{print $1}'

Ps: I've seen a unix System V system destroyed by deleting everything called "core".

Hi Methyl

Thank you for your concern. Sorry for the delayed response
I shall try your suggestion and Revert.

Thanks Again
sidharth

Its good to use ok instead of exec, and confirm before you delete each file.

It is dangerous. We ran a similar command on a dev box and one of the programmers had stored all his 'core' Source code files in a directory called core.

How he chortled when we hosed his files during the housekeeping run.

Still, it was a good test of the backups :rolleyes:

Paul.