Client Login
Call Us: (877) 228-0901 M-F 9am-5pm US EST

How to search a string in a selection of files - LINUX

How to search for a string in a selection of files (-exec grep ...). find . -exec grep "searchthisstring" '{}' \; -print

This command will search in the current directory and all sub directories. All files that contain the string will have their path printed to standard output.

Search and Replace in all files within a directory recursively on Linux

grep -rl matchstring somedir/ | xargs sed -i 's|string1|string2|g'

Contact Information

Code A Site, LLC
140 Preston Executive Dr.
Suite 100-M
Cary NC 27513
877.228.0901 Phone/Fax

This e-mail address is being protected from spambots. You need JavaScript enabled to view it.

Help & Support

Login Form