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