You could use grep
:
-E 'w+'
searches for words
-o
only prints the portion of the line that matches
% cat temp
Some examples use "The quick brown fox jumped over the lazy dog,"
rather than "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
for example text.
# if you don't care whether words repeat
% grep -o -E 'w+' temp
Some
examples
use
The
quick
brown
fox
jumped
over
the
lazy
dog
rather
than
Lorem
ipsum
dolor
sit
amet
consectetur
adipiscing
elit
for
example
text
If you want to only print each word once, disregarding case, you can use sort
-u
only prints each word once
-f
tells sort
to ignore case when comparing words
# if you only want each word once
% grep -o -E 'w+' temp | sort -u -f
adipiscing
amet
brown
consectetur
dog
dolor
elit
example
examples
for
fox
ipsum
jumped
lazy
Lorem
over
quick
rather
sit
Some
text
than
The
use
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…