[Shell command] Append a comma to each line with sed

Created on November 29, 2026

Create a file named dummy.txt with the following contents.

one
two
three

In the substitution s/$/,/, $ matches the end of the line and , is the text to insert there. sed writes the modified lines to standard output.

sed 's/$/,/' dummy.txt
one,
two,
three,
Shell command