Find and Replace Text from the Command Line in Linux

December 10, 2013

Use sed

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

Example:

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



Deep Learning and Artificial Intelligence Newsletter

Get discount coupons, free machine learning material, and new course announcements