리눅스마스터2급

[리눅스마스터2급] grep -v

xemaker 2025. 6. 5. 10:39
[ss@ss]$ cat /etc/passwd | grep -v ss

/etc/password 파일에서 ss라는 문자열이 포함되지 않은 행만 출력한다.

명령어 grep의 옵션 -v 는 검색할 문자열이 포함되지 않은 줄만 출력한다.

man grep을 해보면

-v , --invert-match

Invert the sense of matching, to select non-matching lines (-v is specified by POSIX.)