Convert comma separated items into new line

[root@test]# cat input
a,b,c,d
[root@test]# cat input | sed 's/','/\n/g'
a
b
c
d
[root@test]# cat input | awk '$1=$1' RS=, OFS="\n"
a
b
c
d
[root@test]# cat input | tr -s ',' '\n'
a
b
c
d

Enjoy 🙂

Advertisements