Unix command to prepend text to a file

printf '%s\n%s\n' "to be prepended" "$(cat text.txt)" >text.txt

Leave a Comment