sed 's/happy/enchanted/g' performs substitution: s command substitutes, 'happy' is the pattern to find, 'enchanted' is the replacement, and g flag means global (all occurrences per line). Every instance of 'happy' in chap1 is replaced with 'enchanted'.