Skip to content

sed Command in Linux

The sed (Stream Editor) command in Linux is a powerful utility for text manipulation.

Substitute the string comma (,) for a new line in all occurrences of the lines and output a new file:

1
2
3
4
5
sed 's/,/\n/g' file.txt > outputfile.txt

# s: command for substitution
# \n:  new line
# g: do it in all occurrences of each line
Last update: 2025-09-14
Created: September 14, 2025 13:27:51