New answers tagged


grep's -o will only output the matches, ignoring lines; wc can count them: grep -io "nicolas bomber" annuaire | wc -l or simply, grep -ioc "nicolas bomber" annuaire As you commented, you can match any number of whitespaces coming in between the words, using -z option, grep -iz "nicolas[[:space:]]*bomber" annuaire | wc -l From man grep -i, --ignore-...

Top 50 recent answers are included