/media/dir/dir2//dir4/file.txt:/media/dir/dir2/dir3/file_16072008/es6.txt: "content of the file found from grep"/media/dir/dir2/dir3/dir4/file3.txt:/media/dir/dir2/dir3//file.txt:"other found content"
I want to get this output from grep and print only the found content with the file in which it was found, in this example I want to print (with newline between every file):
/media/dir/dir2/dir3/dir4/file_16072008/es6.txt: "content of the file found from grep"
/media/dir/dir2/dir3/dir4/file.txt:"other found content"
Can you please elaborate your requirement clearly.
your command works fine.
hitendra@nabla:~$ grep -i -r -H match dir
dir/file1:this is 1st match
dir/file1:this is 2nd match
dir/file2:this is another match
dir/file3:matchhh
dir/file3:this is yet another match
hitendra@nabla:~$ grep -i -r -H -w match dir
dir/file1:this is 1st match
dir/file1:this is 2nd match
dir/file2:this is another match
dir/file3:this is yet another match
hitendra@nabla:~$