Syntax
Let's say you want to find where file.html is containg the word 'mywebsite.com' you would run the command (from the folder it is in)grep [OPTIONS] PATTERN [FILE...]
If grep finds it, it will output the entire line it is in, making it easier and faster to analyze your files.grep "mywebsite.com" file.html
To highlight the phrase with a color, you can use the --color option.
To view the line it was found at, you would need to use the -n option.
To do a case insensite server, -i would need to be used.
To use a file wildcard and search all files sharing something in common (like extension, for example), you can use the '*'grep -i -n --color "mywebsite.com" file.html
This would output any line in any html file in that folder containing mywebsite.comgrep -i -n --color "mywebsite.com" *.html
If you want to do it recursively and search all subdirectories, you would need to add the -r option.
Adding -c would give you the number of times the pattern was found, while -l would print the files with matches.grep -r "mywebsite.com" *.html