Uniq

From 탱이의 잡동사니
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Overview

Linux/Unix 명령어 uniq 내용 정리

Basic

중복된 열을 삭제한다.

uniq [OPTION]... [INPUT [OUTPUT]]

Options

-c, --count

중복된 횟수를 나타낸다. <source lang=bash> $ ls /var/log |cut -d'.' -f1 |uniq -c

    13 alternatives
     8 apport
     1 apt
     5 auth
     1 boot
     2 btmp
     1 ConsoleKit
     1 cups
     1 dist-upgrade

</source>

-d, --repeated

중복된 라인들만 나타낸다. 한번만 나타난 항목은 표시하지 않는다. <source lang=bash> $ ls /var/log |cut -d'.' -f1 |uniq -d alternatives apport auth btmp dmesg dpkg kern ... </source>

-i, --ignore-case

대소문자를 구분하지 않는다.