|
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'
 |