- 
                Notifications
    
You must be signed in to change notification settings  - Fork 160
 
Replace text from terminal
        Mert Buran edited this page Apr 17, 2020 
        ·
        1 revision
      
    sed is probably the go-to tool for replacing text in files from terminal.
sed "s/old_text/new_text/g" old_file.txt > new_file.txt
sed -i "s/old_text/new_text/g" file.txt
Oh I should've added an empty string "" after -i!
sed -i "" "s/old_text/new_text/g" file.txt