how to replace word in linux file through for loop code example Example: replace word in file linux command sed -i 's_oldword_replaceword_gI' document_name.txt