Find: Tips and Tricks

From Define Wiki
Revision as of 14:29, 6 January 2013 by David (talk | contribs) (Created page with "Search for a specific file in a directory and run grep against the files found (useful for checking results in various directories) <syntaxhighlight> $ find . -name md.log -exec grep -H...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Search for a specific file in a directory and run grep against the files found (useful for checking results in various directories)

$ find . -name md.log -exec grep -H -n 'Time:' {} \;
./HTDISABLED/Abeta/md.log:529:       Time:   3951.375   3951.375    100.0
./HTDISABLED/Malatase/md.log:4266:       Time:   6007.632   6007.632    100.0
./ALLENDUEL/MalataseAMD/md.log:4527:       Time:   8773.657   8773.657    100.0
./ALLENDUEL/AbetaINTEL/md.log:580:       Time:  18401.943  18401.943    100.0