I'm trying to find a specific line from the newest file I have in subfolders. Files have the same name. So structure is like:
- Folder
- SubFolder1
- filename.xml
- SubFolder2
- filename.xml
- SubFolder1
I'm using grep to have the line
grep -r "mySubString" folder/
I've try using find to sort files as proposed here. But I don't know how to combine both to get just the line from the newest file.
Thanks for your help.
grepon the latest file, even if it finds nothing, or whether you want the output from the latest file wheregrepfinds a match. – AFH Oct 07 '14 at 09:49