You can use Vim in Ex mode:
replace string ALF with BRA in all files in the current directory?
for CHA in *
do
ex -sc '%s/ALF/BRA/g|x'g' -cx "$CHA"
done
do the same recursively for sub directories?
find -type f -exec ex -sc '%s/ALF/BRA/g|x'g' -cx {} ';'
replace only if the file name matches another string?
for CHA in *.txt
do
ex -sc '%s/ALF/BRA/g|x'g' -cx "$CHA"
done
replace only if the string is found in a certain context?
ex -sc ''g/DEL/s/ALF/BRA/g|x'g' -cx file
replace if the string is on a certain line number?
ex -sc '2s/ALF/BRA/g|x'g' -cx file
replace multiple strings with the same replacement
ex -sc '%s/\vALF|ECH/BRA/g|x'g' -cx file
replace multiple strings with different replacements
ex -sc '%s/ALF/BRA/g|%s/FOX/GOL/g|x'g' -cx file