Linux Unix Batch Delete Files

Hi,

Sometimes you may want to delete all trace, log files, audit files completely.

 

 

If any disk or mount pount is nearly full in linux then you will think that What should i delete ?

 

You can find out top directories using following my article

 

 

The answer of above question is mostly log files, trace files, audit files, .xml files and etc…

If you specify logfiles, trace files directory then you can delete all files together like following.

 

–For IBM AIX, Delete all files which extensions are like .trc Under /oracle directory

find /oracle -name "*.trc" -type f -exec rm -f {} \;

 

— For Linux, Delete all files which extensions are like .aud Under /u01 directory

find /u01 -name "*aud" -print | xargs rm -rf

 

You may want to delete files older than 3 days, you can use following query.

find / -name "*.log" -mtime +3 -print | xargs rm -rf

 

You can change extension name and directory name to delete according to your need

 

Mehmet Salih Deveci

I am Founder of IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress mehmetsalih.deveci@outlook.com.-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  mehmetsalih.deveci@outlook.com a mail atabilirsiniz.

2 thoughts on “Linux Unix Batch Delete Files

Leave a Reply

Your email address will not be published. Required fields are marked *