Here’s how to modify a line in a file using sed.

<pre lang="bash">
sed -i 's/replace me.*/with this text/' /path/to/a/file.txt