grep search files containing match word and print line number

原创文章,转载请注明来源并保留原文链接

Today i want to find some files containing the word ‘mongoid’ under a directory.
Try gerp

grep -rl 'mongoid' config/locales/ --color=auto

And i need to know the line number.

grep -orn 'mongoid' config/locales/ --color=auto

Leave a Reply

Your email address will not be published. Required fields are marked *