이 예상되고 문서화 된 동작입니다 : 당신이 대시를 추가하면
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the
matching substring must either be at the beginning of the line, or preceded by a non-word
constituent character. Similarly, it must be either at the end of the line or followed
by a non-word constituent character. Word-constituent characters are letters, digits,
and the underscore.
, 그것은 대시로 첫 번째 단어를 종료는 "비입니다 단어 구성 문자 "입니다. 단어를 함께 쓰면 단어 regexp grep은 하나의 단어로 취급하고 일치하지 않습니다.
정확히 원하는 것은 무엇입니까? 당신은 단지 당신의 라인 football01 아무것도 다른 경우 알고 싶은 경우에 당신이 뭔가를 달성하려면
, 당신은 그것이 무엇인지 설명해주십시오 수
grep -i "^football01$"
로 할 수 있습니다.
더 구체적으로 질문 해주세요. 또한 코드 태그에서 예상 출력을 언급하십시오. – RavinderSingh13
'-w' 플래그는 grep을 전체 단어에만 매치시키고 '-'는 단어 분리 기호로 간주합니다. 'grep -i "^ football01 $"' – 0x5453
@Michael을 사용할 수있는 전체 줄에서 일치 시키려고한다면, 답변 중 하나가 도움이된다면, 질문에 대한 답변을 닫을 수있는 대답으로 표시해 주실 수 있습니까? ?Hannu의 대답은 더 빨리 발표되었고 수용의 더 나은 후보자입니다. – zedfoxus