Searching text in files using grep

Somehow, ack-grep doesn’t work as well anymore, so I’m switching to the good old grep.

grep -iRn keyword path

-i to ignore case sensitivity
-R for recursive search 
-n to display line numbers

Example:

grep -iRn "Thank you for registering" /var/www/mysite

Using vim, you can use the :n command to jump to specific line (replace n with line number).

You can also use the / command in Vim, to search for texts. Jump through previous/next searches with using the N/n command.

Comments are closed.