Forrest logo
back to the sed tool

sed:ai:d2008

How do I change one line in multiple files
$ sed -i 's/oldline/newline/g' file1.txt file2.txt file3.txt
try on your machine

This command replaces 'oldline' with 'newline' in file1.txt, file2.txt, and file3.txt

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.

Questions that are answered by this command:

  • How do I change one line in multiple files?
back to the sed tool