How can I prepend a string to the beginning of each line in a file? August 4, 2023 by Tarik a one-line awk command should do the trick also: awk '{print "prefix" $0}' file