An Entrepreneur, Coach, IT Consultant, Strategic Adviser, and a Traveler craving to explore and contribute to forming a better society.

Saturday, January 17, 2009

Shell Scripting #0008 - Search and Replace in Files Recursively

No comments :
Keywords: Search and Replace in Files recursively, Search and Replace, SED Command, Cut Command, Shell Scripting

Search and Replace in Files recursively

Following is the shell command for search and replace recursively.
files=`grep -R 'search_string' * | cut -f1 -d':'`; for file in $files; do sed -i 's/search_string/replace_string/' $file; done

Keywords: Search and Replace in Files recursively, Search and Replace, SED Command, Cut Command, Shell Scripting

Featured Blog Topics:

No comments :