Add character at the beginning of each line

add
character
at the
beginning of
each line

Add character at the beginning of each line using sed command. For example to add # in front of each line we can use sed command with following syntax:

$ sed ‘s/^/#/’ file.txt
#add
#character
#at the
#beginning of
#each line

Bookmark de permalink.

Geef een reactie

Je e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *