Substitute all matches (global) sed

Replace every occurrence per line with the /g flag

sed 's/foo/bar/g' file.txt