“match exact grep” Réponses codées

match exact grep

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

Match de recherche GREP

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

premier match grep

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 match

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

Réponses similaires à “match exact grep”

Questions similaires à “match exact grep”

Plus de réponses similaires à “match exact grep” dans Shell/Bash

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code