UNIX & GNU/Linux - User commands - Using grep

Maybe you sometimes asked yourself how to find a part of a code inside all your files.
But how to find this part of code?
We can use the grep user command to display this part of a code.

We can moreover display this code in color.

Let's see an example of the grep user command.

The line below has to be typed directly in your favourite shell:

$ grep --color main *

The result is the code "main" in red and the file where the code is found (in purple).

Really helpfull isn't it?

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Refresh Type the characters you see in this picture. Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.