How to split a line into words in Linux ?

Today we will look at an interesting article to know how to split a line into words using extended grep command.

Splitting a Line into Words

[root@nglinux ~]# echo "Welcome to NGELinux.com, have you tried NGEL" | egrep -o "\w+"
Welcome
to
NGELinux
com
have
you
tried
NGEL
[root@nglinux ~]# 

I hope you liked the short trick.

Please do post your comments/suggestions below.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments