find and grep put things onto new lines anyway, so look in the source of the output - you'll probably see the new lines there.
The rest of my response assumes that there are new lines present in the source, but you're just not seeing them on the 'page'
Your browser will be treating the page as html, so new lines in the source are ignored. <br> is the line break tag in html
If there is nothing else on the page then you could set the content type to be text/plain with
at the top of the script - this would give you the plain text, which would preserve any new line charactors
do a PHP find and replace to find new lines ("\n") and replace with a line break tag ("<br />" or "\n<br />" to keep the source readable too) as part of the echo,
echo stream_get_contents(str_replace("\n","\n<br />",$output));
echo this inside html <pre> tags