Skip to content

sed


Add a character to begin of a line

echo "Add a asterix at the begin of this line"|sed 's/$/*/g'

Add a character to end of line

echo "Add a asterix at the end of this line"|sed 's/$/*/g'

Insert line above in the same line

echo hello | sed -e '/hello/i line above' -e '/hello/a line below'

Find all lines that begins on Example and delete one line below

sed -e '/^Example:/ { N; d; }' file.txt