Finding Multiple file type with date restriction linux

25 Views Asked by At

I use SAS Grid and I'm trying to set up a process which looks for files older than 180 days. I need to locate both .sas7bdat and .sas7bndx files. The results are output to a .txt file for manipulation in SASDI

I have been able to locate each file type separately but when I try for multiple extensions I get the error;4

find: paths must precede expression: (-iname

The code I am using is;

$find /opt/SAS/SASdata/DOM/Prod/5_userdata/  -type f \(-iname "*.sas7bdat" -o -iname "*.sas7bndx" \) -mtime +180 -ls >mofindx.txt 

I have tried a few variations of the above like removing the \, or ( or changing the position of the query and get variations on the error.

0

There are 0 best solutions below