Crmgo Blog

Find and Replace Text in a File

Find and Replace Text in a File

Replace 111 with 222 in the file file.txt grep '111' -P -R -I -l file.txt | xargs sed -i 's/111/222/g'

Find and Replace Text in a File

Replace 111 with 222 in the file file.txt

grep '111' -P -R -I -l file.txt | xargs sed -i 's/111/222/g'

Note: This post may be AI-assisted and then human-edited. Editorial responsibility: Dmytro Lomaka, Kaltenkirchen.