GNU grep 2.6.3
Linux version 2.6.32-220.el6.i686 (Red Hat 4.4.6-3)
I have a .dat file that grep will not function on. It's plain text and can be read by all standard output commands, e.g. "less", "cat", etc, so I know what it contains.
If I grep a phrase I absolutely know is in there it does not return, as if it found nothing.
The oddity is if I simply rename it with a different extension, like
file.dat.txt, now grep will work just fine. If I rename it back to
file.dat, once again grep will not find anything.
I also created a .dat file simply with the echo command:
echo "grep this" > test.dat
grep "grep" test.dat returned nothing.
mv test.dat test.dat.txt, now
grep "grep" test.dat.txt worked just fine.
Easy enough workaround (rename the file) but just thought this was odd behavior.