How to use SED to search and replace a string in multiple files in linux

You can use the SED linux command to search and replace a string within all files inside a directory:

This example replaces all occurrences of fast with slow in file names that end in .htm:

$ find ./* -name ‘*.htm*’ -type f -exec sed -i ‘s/fast/slow/g’ {} \;


10 NEW IN BOX SIEMENS QA120AFCWG 20A CIRCUIT BREAKERS COMB. AFCI BEST PRICE picture

10 NEW IN BOX SIEMENS QA120AFCWG 20A CIRCUIT BREAKERS COMB. AFCI BEST PRICE

$298.88



LOT OF 10 SIEMENS QA115AFCN PLUG ON NEUTRAL (NO WIRE) 15A AFCI ARC FAULT NEW picture

LOT OF 10 SIEMENS QA115AFCN PLUG ON NEUTRAL (NO WIRE) 15A AFCI ARC FAULT NEW

$389.99



Q2100 SIEMENS PLUG-IN CIRCUIT BREAKER 2 POLE 100 AMP 120 VAC NEW picture

Q2100 SIEMENS PLUG-IN CIRCUIT BREAKER 2 POLE 100 AMP 120 VAC NEW

$48.75



Siemens QF250A 2-Pole Ground Fault Circuit Interrupter (GFCI) picture

Siemens QF250A 2-Pole Ground Fault Circuit Interrupter (GFCI)

$105.00



Siemens LXD63B600 Circuit Breaker 3 Pole 600 Amp picture

Siemens LXD63B600 Circuit Breaker 3 Pole 600 Amp

$1000.00



Box of 10 - Siemens QA115AFCN 15A 1-Pole Plug-On Neutral Circuit Breaker - Black picture

Box of 10 - Siemens QA115AFCN 15A 1-Pole Plug-On Neutral Circuit Breaker - Black

$320.00



Siemens Q120DFN Arc-Fault/Ground-Fault Dual Function Circuit Breaker picture

Siemens Q120DFN Arc-Fault/Ground-Fault Dual Function Circuit Breaker

$38.00



GFCI Circuit Breaker 20 Amp 2 Pole Self Test Lockout 10ka Interrupting Rating picture

GFCI Circuit Breaker 20 Amp 2 Pole Self Test Lockout 10ka Interrupting Rating

$95.04



  ELECTRICENTER ECQTH3 HANDLE TIE DEVICE (PKG 50) AKA QTH3 BX100HT  picture

ELECTRICENTER ECQTH3 HANDLE TIE DEVICE (PKG 50) AKA QTH3 BX100HT

$39.99



LOT OF 10 SIEMENS QA120AFCN PLUG ON NEUTRAL (NO WIRE) 20A AFCI ARC FAULT NEW picture

LOT OF 10 SIEMENS QA120AFCN PLUG ON NEUTRAL (NO WIRE) 20A AFCI ARC FAULT NEW

$389.99



Powered by WordPress. Designed by WooThemes