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 *