Search for Text with `grep`

Share this video with your friends

Send Tweet

In this lesson, we’ll use grep to find text patterns. We’ll also go over some of the flags that grep has that can be combined together to make it more powerful and easier to read.

Lorenzo Gamboa
Lorenzo Gamboa
~ 6 years ago

This lessons seems to break at the beginning of the video.

Renato Nouman
Renato Nouman
~ 6 years ago

I am trying to grep a variable which is the output of a find command. I'm getting permission denied from the grep, but if I pass the same file directly it works. How could I solve that?

var=`find . -path ./node_modules -prune -o -path ./public -prune -o -type f -name "*.scss" -print`
grep "string" `$var`

Any tips?

~ 4 years ago

Strange, the grep command is only showing me 1 or 2 results when I invoke it on a keyword list with tons of results. My Keyword text file has hundreds of results containing what I invoke grep to find in it though. How could that be?