user@cs ~/ $echo -e "I like soccer You like football" | sed '/soccer/c Nobody likes soccer' Nobody likes soccer You like football user@cs ~/ $cat bar.txt One Two user@cs ~/ $sed '/One/c 1' bar.txt 1 Two