I have many files as below present in a directory.
data.20091009_0915_app.out
data.20091009_0915_db.out
data.20091009_0915_dbm.out
data.20091009_0915_lock.out
data.20091009_0930_app.out
data.20091009_0930_db.out
data.20091009_0930_dbm.out
data.20091009_0930_lock.out
data.20091009_0945_app.out
data.20091009_0945_db.out
data.20091009_0945_dbm.out
data.20091009_0945_lock.out
data.20091009_1000_app.out
data.20091009_1000_db.out
data.20091009_1000_dbm.out
data.20091009_1000_lock.out
data.20091009_1015_app.out
data.20091009_1015_db.out
data.20091009_1015_dbm.out
data.20091009_1015_lock.out
data.20091009_1030_app.out
data.20091009_1030_db.out
data.20091009_1030_dbm.out
data.20091009_1030_lock.out
I would like to retain files only with the pattern "data.*_0945*out and delete rest all the files. How can implement it ?
After cleanup I want only the following 4 files
data.20091009_0945_app.out
data.20091009_0945_db.out
data.20091009_0945_dbm.out
data.20091009_0945_lock.out
data.20091009_0915_app.out
data.20091009_0915_db.out
data.20091009_0915_dbm.out
data.20091009_0915_lock.out
data.20091009_0930_app.out
data.20091009_0930_db.out
data.20091009_0930_dbm.out
data.20091009_0930_lock.out
data.20091009_0945_app.out
data.20091009_0945_db.out
data.20091009_0945_dbm.out
data.20091009_0945_lock.out
data.20091009_1000_app.out
data.20091009_1000_db.out
data.20091009_1000_dbm.out
data.20091009_1000_lock.out
data.20091009_1015_app.out
data.20091009_1015_db.out
data.20091009_1015_dbm.out
data.20091009_1015_lock.out
data.20091009_1030_app.out
data.20091009_1030_db.out
data.20091009_1030_dbm.out
data.20091009_1030_lock.out
I would like to retain files only with the pattern "data.*_0945*out and delete rest all the files. How can implement it ?
After cleanup I want only the following 4 files
data.20091009_0945_app.out
data.20091009_0945_db.out
data.20091009_0945_dbm.out
data.20091009_0945_lock.out