Archive for the ‘Syntax for find command’ Category

Syntax for find command

Wednesday, March 18th, 2009

Syntax for find command.


 

Syntax for find.

 

Disclaimer: Apply to a TEST environment first. Use on production systems is at DBAs own risk.

 

1)

find /u01/app/oracle/admin/OEMREP/udump -name “*.trc” -mtime +30 -exec ll {} \;

 

  • This searches in /u01/app/oracle/admin/OEMREP/udump for any files with names ending with .trc older than 30 days and displays the results into your screen.

 

2)

Important: Before you execute the following be aware that it would delete files that it finds:

find /u01/app/oracle/admin/OEMREP/udump -name “*.trc” -mtime +30 -exec rm -f {} \;

  • This searches in /u01/app/oracle/admin/OEMREP/udump for any files with names ending with .trc older than 30 days and DELETES them.

 

3)

find $APPL_TOP -name adstrtal.sh -exec ll {} \;

This searches in $APPL_TOP for file adstrtal.sh and displays the result into your screen.



Google