for i in $(find . -type f); do sed 's/oldstring/newstring/g' $i > $i-tmp; mv $i $i-backup; mv $i-tmp $i; done
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Mass find-replace using sed (See related posts)
You need to create an account or log in to post comments to this site.
Related Posts
» Search & replace with find & ed in find grep shell osx mac search bash unix text file replace ed binary
» Mass find-replace using sed in find search sed replace
» Replace Protected-Private Posts in databases find email rails grep kernel password regex mod_deflate tiger prompt cgi dns sql server java form regular regexp persistent gnome day tsql cli ms-sql access_log mod_rewrite safari mod_proxy_balancer XSLT ftp rename keepalive hack oop home web graph defaults IMVU xmlplarser replace widget flaxen Space information module e-mail stylesheet ident checkident signup inline myodbc profile pop clamdscan cocoadialog imap groovy scipy webpy dump lsregister touch info buffer seq contact as codeigniter file_column album playone readlink realpath decoder if map drop navigation carbon guid laptop report ipod Is sinatra posts Set clip isight ul pack sesion connection seconds shift actionscript3 mxml typesofloops Remoting rb Protected-Private
» bash shell code to replace t... in svn bash sed replace strings
» Counting lines in awk grep shell osx mac bash line unix c count file sed directory lines wc countlines
» Find largest files on Mac OS X in find awk sort regex shell osx mac bash unix linux c filesystem file ls array mount sed size directory mdfind scan device gnu volume largest printf stat xdev bsd partition bigfiles localvols
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails