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
sidharthmellam:
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
methyl
December 17, 2009, 11:09am
3
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
thegeek
December 31, 2009, 3:24am
5
Its good to use ok instead of exec, and confirm before you delete each file.
opsmgr
January 6, 2010, 5:44am
6
methyl:
Be careful. There are files and directories called "core" on most unix systems (including HP-UX) which are not "core files".
This is dangerous.
Ps: I've seen a unix System V system destroyed by deleting everything called "core".
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.