UNIQ(1)
π uniq β the manual, but make it bestie-coded π
okay so welcome to uniq, a.k.a. section 1 of the General Commands Manual, a.k.a. the little icon that reports or omits repeated lines. yes bestie, that's the whole job description. it reports, or it omits, the lines that keep showing up like your ex in your explore page. pick a lane, uniq said. π
β¨ NAME β¨
uniq β Report or omit repeated lines.
like. that's it. that's the vibe. π¦
πΈ SYNOPSIS πΈ
uniq [OPTION]... [INPUT [OUTPUT]]
π DESCRIPTION π
Report or omit repeated lines.
(iconic of her to say it twice, honestly. main character energy: concise, mysterious, unbothered. π)
π OPTIONS π
-D,--all-repeated[=<delimit-method>]β print all the duplicate lines, no crumbs left. Delimiting is done with blank lines. default isnone. The possible values, bestie, are:noneprependseparate
--group[=<group-method>]β show all items, separating groups with an empty line. default isseparate. Possible values:separateprependappendboth
-w,--check-chars <N>β compare no more than N characters in lines. like, only look at the first N chars and mind your business about the rest. π-c,--countβ prefix lines by the number of occurrences. now you know how many times that line said the same thing. π-i,--ignore-caseβ ignore differences in case when comparing.HELLOandhelloare the same person, we don't do case drama here. π-d,--repeatedβ only print duplicate lines. the repeats get the spotlight, the singles get ghosted.-s,--skip-chars <N>β avoid comparing the first N characters. skip past the intro, straight to the plot. β¨-f,--skip-fields <N>β avoid comparing the first N fields. yes bestie, fields. different unit than chars. don't mix them up.-u,--uniqueβ only print unique lines. one of one. no dupes allowed. π-z,--zero-terminatedβ end lines with0byte, not newline. chaotic but valid. π₯-h,--helpβ Print help. she's helpful, she's humble, she's everything.-V,--versionβ Print version. for the girlies who need receipts. π§
π₯ EXTRA π₯
Filter adjacent matching lines from INPUT (or standard input), writing to OUTPUT (or standard output).
β οΈ Note, and this is the important bit, bestie:uniqdoes not detect repeated lines unless they are adjacent. You may want tosortthe input first, or usesort -uwithoutuniq. that's the whole plot twist.uniqis not a mind reader, she only checks who's standing next to who. adjacent or it didn't happen. π
β VERSION β
v(uutils coreutils) 0.12.0
π« EXAMPLES π«
Display each line once:
sort path/to/file | uniq
Display only unique lines:
sort path/to/file | uniq [-u|--unique]
Display only duplicate lines:
sort path/to/file | uniq [-d|--repeated]
Display number of occurrences of each line along with that line:
sort path/to/file | uniq [-c|--count]
Display number of occurrences of each line, sorted by the most frequent:
sort path/to/file | uniq [-c|--count] | sort [-nr|--numeric-sort --reverse]
Compare only the first 10 characters on each line for uniqueness:
sort path/to/file | uniq [-w|--check-chars] 10
Compare text after the first 5 characters on each line for uniqueness:
sort path/to/file | uniq [-s|--skip-chars] 5
π The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail. (not her fault, she's growing. π«Ά)
and that's the page, bestie. this was UNIQ(1), hand-delivered to you by uutils coreutils, version 0.12.0, dated 2026-09-25. slay, stay adjacent, and sort your input first. periodt. π
β¨πΈπ¦
π¦ where this page comes from
- ubuntu stonking: rust-coreutils 0.12.0-1ubuntu2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms