Notice
Recent Posts
Recent Comments
준호씨의 블로그
How to subtract two files using grep 본문
반응형
fileA
a
b
c
10
20
30
fileB
b
c
d
30
fileA - fileB
$ grep -F -x -v -f fileB fileA
1
10
20
shorter way
$ grep -Fxvf fileB fileA
1
10
20
man grep
...
-F, --fixed-strings
Interpret pattern as a set of fixed strings (i.e. force grep to behave as fgrep).
-f file, --file=file
Read one or more newline separated patterns from file. Empty pattern lines match every input line. Newlines are not considered
part of a pattern. If file is empty, nothing is matched.
...
-v, --invert-match
Selected lines are those not matching any of the specified patterns.
...
-x, --line-regexp
Only input lines selected against an entire fixed string or regular expression are considered to be matching lines.
...
반응형
'개발이야기' 카테고리의 다른 글
perl - 터미널에서 module 설치 여부 확인 하기 (0) | 2017.05.22 |
---|---|
perl - encode json (0) | 2017.05.21 |
python - Number to String. String-Number concatenation (0) | 2017.05.11 |
tcping - check a specific port is open (0) | 2017.04.30 |
SPF should written in TXT Record (not SPF Record) (0) | 2017.04.24 |
Comments