I can search through all my files for a specific string and output in a txt document without issue. I can't seem to figure out how to also capture the date of the files in the output results.
grep -rnw '/my_path/' -e 'search_string' > list.txt
That works for finding the files, but when I try piping any additional commands like stat, date, or ls I can't seem to get the date of the files to output with file names.
grep -rnw '/my_path/' -e 'search_string' | stat -c %n':'%z > list.txt
This does not seem to work to get the dates of the files in my output.