A grep command to search for a popular string in a vendor/ directory.
It aims to be more efficient (performance, readability) than what IDE commonly do :
grep -rlP 'sylius\.grid' vendor/ | grep -vP 'xml|Test|rst'
- Find all occurences in vendors
-r vendor/with a regex-Pfor 'syliusDOTgrid', 'DOT' being a real dot between 'sylius' and 'grid', but only display file names-lto avoid dozens of matches being in those files - Pipe
|results and excludegrep -vwith a regex-Pfiles containing 'xml', 'Test' or 'rst'xml|Test|rstin their path, since these files usually have lots of occurences and not the golden piece of code you search for ;)
It remains simple to write and efficient, do you have other tips with grep?