I am trying to delete a load of core files, but make sure I only delete core files. The system I am using has many files with core in the name, so I obviously can not simply search for "core".
I have tried using the 'find' command with pattern matching via [0-9], and know that his is the way forward. However, I can not work out how to ensure there are no alphabetic characters in the file extension.
So far I have the following:
However, this will still delete files called "core.1a". Please do not question why anyone would call I file this - it just might be the case, and I have to ensure I avoid these files.
So I need a regular expression that will find:
files
starting with "core."
with an extension of one or more numbers
without an alphabetic lower or uppercase character in the extension
Must be a pretty standard cron job set up an many systems I imagine?
Hi Techies,
I need a help in finding junk characters and remove them from a Datafile.
we have a file and it had crores of records like below
SGSN_MCC_MNC=01150
but sometime due to the issue with sending server we are getting some junk characters in the middle of data like below
... (6 Replies)
Hi,
I want to match the pattern in file1 with file2 and print the value in file2 and paste in file1
file1:
ISHO RT SR Major 96.46778
Drop Call Rate CS Critical 0.5072662
ISHO RT SR Major 97.754364... (3 Replies)
I am on ubuntu 11.10 using bash scripts
I want to remove all files matching a string pattern and I am using the following code
find . -name "*$pattern*" -exec rm -f {} \;I have encountered a problem when $pattern is empty. In this case all my files in my current directory were deleted. This... (3 Replies)
Hi,
I am trying to write a script that list down all the files that do not match the pattern
My pattern will be like this "*.jpg|*.xml|*.sql". This pattern will be stored in a file. The script need to read this pattern from the file and delete the files that does not match this pattern. It... (7 Replies)
Hi,
I want to find all directories matching given pattern in current directory and zip those files.
I am trying to do somethign like this. But it is not working.
for FNAME in $(find . -type d | grep './\{2\}-\{2\}$');
do
zip -r MatchedFiles.zip $FNAME
rm -fr $FNAME
done
... (4 Replies)
Hi,
I'm searching for a pattern 'java' under a directory but it is returning all the files containing 'java', but I want to have only distinct files not all.
please help (2 Replies)
Hi all,
I have to check whether certain files exist using a if statement. I have to check this by matching a pattern of filename: e.g.
if ]
This statement should be "true" if any files like test.dat11, test.dat22 etc are present in the source dir. However, this statement is checking only... (2 Replies)
Hi,
I have following files in my directory:
/TESTDONTDEL> ls -alt
total 14
drwxr-xr-x 2 oracle dba 1024 May 15 06:30 .
-rw-r--r-- 1 oracle dba 40 May 15 06:30 exception.txt
-rw-r--r-- 1 oracle dba 19 May 15 06:22 ful_1234_test1.txt
-rw-r--r-- 1... (2 Replies)
Hi,
i need to break a file into 2 files afetr matching a pattern
for ex. there is a fil, file .txt which contains
here i need to look for mat $ demon if it matches then i need to transfer the data into another file till the line in which a "d6s" comes,and i have to delete tat line... (3 Replies)
Hi,
I am writing a BASH shell script. I would like to count all the files in the CURRENT directory matching a specific pattern. Could someone suggest the best/simplest way to do this. I have thought of these solutions (for simplicity the pattern is all files starting with A):
ls -1 *A | wc -l... (5 Replies)