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.

Leave a Reply

avatar
  Subscribe  
Notify of