User Tools

Site Tools


tips:linux:replacefiles

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revision Both sides next revision
tips:linux:replacefiles [2009/06/08 08:28]
erik created
tips:linux:replacefiles [2009/06/08 08:29]
erik
Line 1: Line 1:
 +====== How to find and replace on many files? ======
  
 +The following commands make it easy to find and replace some text in a set of files:
 +
 +<code>
 +for fl in *.txt; do
 +mv $fl $fl.old
 +sed 's/find/replace/g' $fl.old > $fl
 +done
 +</code>
tips/linux/replacefiles.txt · Last modified: 2020/05/29 21:54 by erik