“Grep Exact Match” Respostas de código

Grep Exact Match

echo olavo|grep -E "^olavo$" # returns olavo
echo olavo|grep -E "ola$"    # returns none
Tiago F2

Grep Search Match

grep -rn regex_search folder_where_to_search
#Ex: search pattern in "." current folder (r) recursively
grep -rn pattern .
Armandres

Grep Primeira partida

Just combine grep with head command for filtering  only the first match as:
grep "match" | head -n 1   #Change 1 to not only match first but further matches
Armandres

grep ou correspondência

$ grep "PATTERN1\|PATTERN2" FILE
$ grep -E "PATTERN1|PATTERN2" FILE
$ grep -e PATTERN1 -e PATTERN2 FILE
$ egrep "PATTERN1|PATTERN2" FILE
knavels

Respostas semelhantes a “Grep Exact Match”

Perguntas semelhantes a “Grep Exact Match”

Mais respostas relacionadas para “Grep Exact Match” em Shell/Bash

Procure respostas de código populares por idioma

Procurar outros idiomas de código