Hi All,
I have one query for search string in un-known files in Linux OS but file time stamp is less than a minute only while search , if possible any command as per criteria then please share command .
grep "success" string in a unknown-file before one minute .
Below 2 out puts need as per search string .
1) print file name
2) full path of the file
Example :
grep "success" /tmp/my-test/testing/logs/mars/water/*/logs/*.*
out put of the file or files with path
condition is less than a minute .
I hope explained query clearly .
I am waiting for your valuable information .
Regards,
Jeesshnasree
Hi
find /tmp/my-test/testing/logs/mars/water -mmin -1 -exec grep -l "success" {} \;
and then follow https://learn.redhat.com/t5/General/Print-end-of-the-directory-only/m-p/45154#M8887
variant:
tty=$(tty) ; find /tmp/my-test/testing/logs/mars/water -mmin -1 -exec grep -l "success" {} \; | tee $tty | sed 's|.*/\(.*$\)|\1|'
Hi
find /tmp/my-test/testing/logs/mars/water -mmin -1 -exec grep -l "success" {} \;
and then follow https://learn.redhat.com/t5/General/Print-end-of-the-directory-only/m-p/45154#M8887
variant:
tty=$(tty) ; find /tmp/my-test/testing/logs/mars/water -mmin -1 -exec grep -l "success" {} \; | tee $tty | sed 's|.*/\(.*$\)|\1|'
Hi
you miss first "t" in variant's example, check, please. Result should be more usefull
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.