개요
- 리눅스 uniq
- /usr/bin/uniq
- 중복된 내용의 행이 연속으로 있으면 중복 없이 하나의 행으로 만들어 주는 리눅스 유틸리티
- 흔히 sort와 함께 사용함
- -c 옵션을 붙이면 중복행의 개수를 출력함
실행예시 1: 기본 uniq
root@zetawiki:~# cat fruits.txt
orange
apple
apple
orange
orange
apple
root@zetawiki:~# cat fruits.txt | uniq
orange
apple
orange
apple
실행예시 2: sort 후 uniq ★
root@zetawiki:~# cat fruits.txt | sort | uniq
apple
orange
실행예시 3: -c 옵션
root@zetawiki:~# cat fruits.txt | sort | uniq -c
3 apple
3 orange