List specific files from directories

Hello,
I would like to list the files from all directories that has been modified more than 1 month ago, and whose name is like '*risk*log'.

I think a script like this should work :

ls -R | find -name '*risk*.log' -mtime 30 -type f

But it tells me "no file found" though I can see some.

Could you tell me what mistake I made ?

Thanks.

Hi Filippo,

Try the following syntax:
find . -name \*risk*.log -mtime -30 -exec ls -ltr {} \;

Regaeds,
Nir

Thanks Nir !

If you want more than a month ago you need to use -mtime +30

Thanks dangral :wink: