Find and Replace Text from the Command Line in Linux

Use sed

sed -i 's/<original_text>/<replacement_text>/' <file.txt>

Example:

sed -i 's/Bob/Alice/' names.txt