Find and grep combination in CygWin under Windows or recursive file grepBy neokrates, written on November 10, 2010 |
bash snippet |
- neokrates
- Email: uwarov@yahoo.com
- Website: http://www.thinkplexx.com
- Join date: 05-31-09
- Posts: 20
Rate it
Ad
Poll
Estimate your experience level with Virtualization technology?
- No experience (100%, 4 Votes)
- Guru (0%, 0 Votes)
- Expert / Admin (0%, 0 Votes)
- Professional / Developer (0%, 0 Votes)
- User (0%, 0 Votes)
- Beginner (0%, 0 Votes)
- Have tried (0%, 0 Votes)
Total Voters: 4
Loading ...
Most popular search terms:
Combining find and grep under Linux is trivial, there are many ways, they all work. Most piped versions didn’t work for me under Windows. So that seems to be the problem of selecting the one command, which does work. Many, which are supposed to work, do fail under cygwin (that can be also dependent on CygWin version you have)
But the two calls presented here did work:
1. Find recursively all makefiles and grep them for “(CP”, then write the output into found_in_make.txt file.
find . -name 'makefile' -exec grep "(CP" {} \; > found_in_make.txt
2. Recursively grep excluding all “.svn” directories and searching through .mk files
grep.exe --exclude-dir="\.svn" -r '$(CP' . *.mk
|
TAGS
|
|
SOCIAL
|


















