?script/cmds 2 list open files????

I would like to have the commands or a scripts that will show me files that are not open by any process and meet a certain pattern (ie arch.log1_117512.dbf).

Basically I a wanting to delete all arched redo logs that oracle has popped out execpt for the current one it is writting to. I am assuming that the ones it is done writting to are not opened by any process.

I have searched through my books and I can not find anything telling me how to determine if a file is open and who has it open.

A breif explanation of any commands given would be greatly appreciated.

Harry Britton
::email removed::

You may be able to write a C program around the <B>fstat</B> system call to do the trick:

The fuser command can be used to determine if there is any process using a specified file. It is available on HP-UX, Solaris, and Linux at least...probably others too.

You could also execute an ls -lu to see when the file was last touched. To do this for an entire directory /var/adm, exectute;
for i in /var/adm
do ls -lu $i

Or, to delete any files older than x days, use;
find /var/adm -ctime +x -exec rm -f {} \;