리눅스에서 grep 명령어로 단어패턴을 가진 행을 찾으려하는데요.
말로 하기 힘들어 예를 들어서 말하겠습니다.
apple orange banana pineapple
과 같이 되어있을 때
grep 'apple' file
이렇게 하면 pineapple 까지 나옵니다.
절대적으로 apple 만 나오는 것을 찾아라 라고 하려면 어떤 옵션을 붙여야하나요?
https://unix.stackexchange.com/questions/206903/match-exact-string-using-grep 여러 개 답 중 적어도 하나는 되겠죠?
세벌 https://sebuls.blogspot.kr/
정규표현식을 쓰시면 됩니다. grep -e '^apple$' file
file 안에
This is an apple.
단어라고 하면 보여주는게 맞을거 같아요. grep -w apple 요렇게 하면 되지 않나요?
https://unix.stackexchange
https://unix.stackexchange.com/questions/206903/match-exact-string-using-grep
여러 개 답 중 적어도 하나는 되겠죠?
세벌 https://sebuls.blogspot.kr/
정규표현식을 쓰시면 됩니다.
정규표현식을 쓰시면 됩니다.
grep -e '^apple$' file
file 안에 This is an apple. 있다면?
file 안에
세벌 https://sebuls.blogspot.kr/
단어라고 하면 보여주는게 맞을거 같아요.
단어라고 하면 보여주는게 맞을거 같아요.
grep -w apple 요렇게 하면 되지 않나요?