Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
google site



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-14-2009
Registered User
 

Join Date: Nov 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Smile [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
Sponsored Links
  #2  
Old 12-14-2009
Registered User
 

Join Date: Mar 2008
Location: Germany
Posts: 43
Thanks: 0
Thanked 1 Time in 1 Post
find ..... rm

Quote:
Originally Posted by sidharthmellam View Post
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
  #3  
Old 12-17-2009
Registered User
 

Join Date: Mar 2008
Posts: 2,394
Thanks: 10
Thanked 77 Times in 76 Posts
Be careful. There are files and directories called "core" on most unix systems (including HP-UX) which are not "core files".

This is dangerous.
Quote:
find / -name core -exec rm -f {} \;
To get a list of files which are definitely core files.

Code:
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".
  #4  
Old 12-31-2009
Registered User
 

Join Date: Nov 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Wink Thank you for your concern

Hi Methyl

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


Thanks Again
sidharth
  #5  
Old 12-31-2009
thegeek thegeek is offline Forum Advisor  
Registered User
 

Join Date: Apr 2009
Location: /usr/bin/vim
Posts: 933
Thanks: 6
Thanked 18 Times in 16 Posts
Its good to use ok instead of exec, and confirm before you delete each file.
  #6  
Old 01-06-2010
Registered User
 

Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by methyl View Post
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

Paul.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ls > file - Creating file containing the list of all files present in a directory pranavagarwal Shell Programming and Scripting 1 09-26-2008 08:37 PM
Script to find all the files that contain any of the words present in another file tsanthosh Shell Programming and Scripting 4 05-21-2008 02:29 AM
Script for Deleting Core files on root filesystem rgfirefly24 Shell Programming and Scripting 7 02-11-2008 04:41 PM
deleting files based on file name and modified time ammu UNIX for Dummies Questions & Answers 1 01-22-2008 10:09 AM
Deleting core file?? alc640 UNIX for Dummies Questions & Answers 1 04-13-2007 09:52 AM



All times are GMT -4. The time now is 02:59 AM.