Call Us: (877) 228-0901 M-F 9am-5pm US EST Bookmark and Share

FREE CONSULTATION

Fill in form below





Member Login



How to search a string in a selection of files - LINUX PDF  | Print |  E-mail

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'
Comments (0)Add Comment

Write comment

security code
Write the displayed characters


busy
 
© 2006-2009 Code A Site, LLC