Delete files

i need to create a script. and this script can delete all files that contains the word """CORRECTED""""  
and more than """" 14 days"""
file name:
-rw-r--r--   1 moto_sys staff    16126 Feb  4 13:23 'File.J0803100'_CORRECTED_ID001235
-rw-r--r--   1 moto_sys staff    4345 Jan 28 16:05 file.sdfadfe.dat
-rw-r--r--   1 moto_sys staff    16126 Jan 17 18:24 'File.J0123400'_CORRECTED_ID001234

moto_sysAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kent OlsenData Warehouse Architect / DBACommented:
Hi moto_sys,

find {path} -ctime 1209600 -name "*CORRECTED*" -exec rm {} \;

Note that the -ctime value is exactly 14 days from the current timestamp, and not relative midnight.


Good Luck,
Kent
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TintinCommented:
find /some/dir -name "*CORRECTED*" -mtime +14 | xargs rm
0
Suhas .QA ManagerCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup Zone:

Split: Kdo {http:#20840575} & Tintin {http:#20843391}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Suhas
Experts Exchange Cleanup Volunteer
0
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.