append a line at the beginning of a file in unix code example Example: add line to beginning of file shell script $ sed -i '1s/^/added text /' file