title: Replacing string in file Unix
body: <p>I have a text file <code>file1.txt</code> on Unix. I'd like to produce another file <code>file2.txt</code>, in which I replace all occurrences of <code>apple-pie</code> with <code>apple_pie</code>. What command can I use?</p>