grep output on stdout and grep output to file don't match
Hi when I grep a log file e.g
grep pattern /var/log/something
I get the full line of text line for line.
Now if I do
grep pattern /var/log/something > outputFile
The lines in the output are truncated there are words in the middle missing.
Any idea why redirecting the output to a file truncates the output?
I tried the following as well and this didn't work either:
grep pattern /var/log/something 2>&1 > outputFile
and if I do
grep -C 1 pattern /var/log/something > outputFile
I get more than I want in the file although it does include what I need.