It is a string substitution command used in ed, sed, vi, perl, and likely other utilities. Substitute have for of, the g means globally. That is all "of" on the line are changed to "have". Without the g, only the first "of" in the line.