Breaking it down
‘sed’ – the stream editor
$ cat file | sed 's/kg/kilograms/g' > new-file