I have a file as such, infile.txt
:
foo bar
hello world
blah blah black sheep
I want to get:
foo
bar
hello
wolrd
blah
blah
black
sheep
I've tried this
echo infile.txt | sed -e 's/[[:space:]]/\n/g' | grep -v '^$'
but it doesn't recognize the line breaks and outputs:
foo
bar
hello
wolrd
blah
blah
black
sheep
How do I achieve the desired output?