Instructor: 00:01 I've pulled MPMs through a repository here locally. Let's say I want to find all uses of mpm.config.get. I want to look for that in inaudible mpm.js file. Each line is a match that was found on the file. These lines aren't necessarily next to each other in the file or anything. These might be totally different lines all over the file.
00:47 That output is a little difficult to read. We can add more flags to grep to change the output and make it easier to read. Let's run this first one again.
00:55 If we add the color flag, that's the same thing, but it colorizes the match. Another useful one is the end flag. This will output the line number it's found on, which can be useful if you want to then go open the file in the text editor and jump right to the line. Another one that's useful is the context flag. This shows context around each match.
01:16 If I pass 1 to it, you can see it shows the match here and then, it shows the single line around the match. We can, of course, change that to whatever we want if we want more context. Also, notice in this display that it separates each matching block. Grep also supports regex. If we do grep, it'll do color, line numbers, and it'll do e for regex. Then, we'll do the same thing again.
01:44 There's a config.get and a config.sent method. We'll do that. We'll use a regex to be tricky and look for both of them. We'll search the mpm.js file. We can see that that is matching both of those methods there.
01:58 Grep has tons of flags. Look at main grep to view all the options.