Monday, 24 September 2012

Using sed to add text to the beginning or end of every line in a file

Add "bla" to the beginning of every line in a file:
sed -i 's/^/bla/' filename
Add "bla" to the end of every line in a file:
sed -i 's/$/bla/' filename

No comments:

Post a Comment