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


 
Thread Tools Search this Thread
Operating Systems HP-UX [Solved] Deleting a all core files present in file systems ?
# 1  
Old 12-14-2009
Bug [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
# 2  
Old 12-14-2009
find ..... rm

Quote:
Originally Posted by 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
# 3  
Old 12-17-2009
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
Hammer & Screwdriver 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
Its good to use ok instead of exec, and confirm before you delete each file.
# 6  
Old 01-06-2010
Quote:
Originally Posted by 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 Smilie

Paul.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Move files only if no other file is present there in first place

Hi, I am not that good in writing shell scripts. I need your help. I have a lot of files which need to moved to another directory but I can do it only if there are no files present there in the first place. I have an auto delete present to delete files from the destination Directory but still I... (5 Replies)
Discussion started by: Crazy_Nix
5 Replies

2. Solaris

[Solved] No tty present and no askpass program specified!

Hi Guys, I use a script sdcmdeploy.ksh to deploy java application to respective dev/test environment. This script is being executed on SunOS. These apps are weblogic apps & the script internally calls weblogic deploy script to deploy application to weblogic cluster. But at this point it... (2 Replies)
Discussion started by: raj100
2 Replies

3. Ubuntu

[Solved] Deleting hash files

dear all, I have trouble handling the files with the # (ie: #file.txt). I try deleting them several ways, but get failed everytime. Please let me know how to a.) delete them b.) how to get rid of creation of these files. thank you very much, emily (4 Replies)
Discussion started by: emily
4 Replies

4. Shell Programming and Scripting

[Solved] Issue with deleting files through find

Hi, I have a script similar to this #!/bin/ksh cd /orcl/bir/eod_badfiles find ./ -type f -name "*.csv" -mtime +6 -exec rm -f {} \; find ./ -type f -name "*.bad" -mtime +6 -exec rm -f {} \; cd /orcl/bir find ./ -type f -name "*.log" -mtime +6 -exec rm -f {} \; This was working fine in one... (5 Replies)
Discussion started by: Gangadhar Reddy
5 Replies

5. Shell Programming and Scripting

cp RAW files if JPEG file present

hi guys and girls, i have a folder containing RAW and JPG images. eg... 001.jpg 003.jpg 005.jpg 001.raw 002.raw 003.raw 004.raw 005.raw I want to copy only RAW files that have a corresponding JPG file in to a new folder. the jpg files do not need to be copied. in this example i... (6 Replies)
Discussion started by: fxylxy
6 Replies

6. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

7. Shell Programming and Scripting

ls > file - Creating file containing the list of all files present in a directory

Hi All, I need to create a file which contains the list of all the files present in that directory. e.g., ls /export/home/user/*.dat > list_file.dat but what i am getting is: $ ls /export/home/user/*.dat > list_file.dat /export/home/user/*.dat: No such file or directory But I have... (1 Reply)
Discussion started by: pranavagarwal
1 Replies

8. Shell Programming and Scripting

Script to find all the files that contain any of the words present in another file

Hi All, I am new to UNIX and shell scripts and also new to this forum. I need a script to find all the files in a directory that contain any of the strings present in another file. Please provide me the script or if you could provide pointers to any link in this forum it would be helpful.... (4 Replies)
Discussion started by: tsanthosh
4 Replies

9. Shell Programming and Scripting

Script for Deleting Core files on root filesystem

ok i am setting up a script to run daily using crontab. This script will search the root filesystem and delete any and all core files. I have set up this script The only problem i get with this script is it searches for directories and attempts to delete them. Since i have probably... (7 Replies)
Discussion started by: rgfirefly24
7 Replies

10. UNIX for Dummies Questions & Answers

Deleting core file??

Hi, I am using UNIX through Exceed on my PC to gain access to some CFD programs. One of these programs crashed a couple of days ago and created a file called core, which i understand is a back up file and can be deleted immediately. However, before deleting it I rearranged some of my other files... (1 Reply)
Discussion started by: alc640
1 Replies
Login or Register to Ask a Question