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
» bash shell code to replace t... in svn bash sed replace strings
» Counting lines in awk grep shell osx mac bash line unix count file sed directory lines wc
» Clearing out a bunch of spam... in find awk xargs postfix email spam spool
» View processes, grep out by ... in awk ps sysadmin grep kill
» delete a filename starting w... in find shell
» Find and change a users uid in find nfs cli
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails