Consider the following command:
ls dir1 dir2 file1 x1 x2 y2
when this output is piped into e.g. grep each file/directory is processed as an 'item'.
ls | grep f file1
So obviously there is a distinction between the actual output that a
ls produces and the input that is processed by grep.
Since grep operates on lines one could expect that
ls | grep f would show the whole first line, namely:
dir1 dir2 file1
What am I missing here? What is the mechanism behind this behavior?