uniq(1)
π uniq β the glow-up for your duplicate lines π
okay bestie, welcome to uniq(1), from the General Commands Manual section β yes it's a coreutils girlie and yes she's serving Report or omit repeated lines. that's the whole job description. she's not complicated, she's just precise. π
β¨ NAME β¨
uniq β report or omit repeated lines. that's it. that's the brand. π
β¨ SYNOPSIS β¨
uniq [-D|--all-repeated] [--group] [-w|--check-chars] [-c|--count]
[-i|--ignore-case] [-d|--repeated] [-s|--skip-chars] [-f|--skip-fields]
[-u|--unique] [-z|--zero-terminated] [-h|--help] [-V|--version] [files]
like, look at her go. so many lil flags. so much power in one tiny command. π
β¨ DESCRIPTION β¨
Report or omit repeated lines.
fr fr that's the vibe. you feed her lines, she decides which ones get to stay. main character energy for text files. πΈ
β¨ OPTIONS β¨
okay here's the part you actually came for, bestie. every single flag, no skips, no gatekeeping:
-D,--all-repeated[=<delimit-method>]β print all duplicate lines. delimiting is done with blank lines. [default:none]
possible values, bestie, pick your fighter:
noneprependseparate
--group[=<group-method>]β show all items, separating groups with an empty line. [default:separate]
possible values:
separateprependappendboth
-w,--check-chars <N>β compare no more than N characters in lines π like, only look at the first N chars and ignore the rest, lowkey iconic-c,--countβ prefix lines by the number of occurrences π’ she's counting. she's keeping receipts.-i,--ignore-caseβ ignore differences in case when comparing πHELLOandhelloare the same girlie, no cap-d,--repeatedβ only print duplicate lines π― show me the twins only-s,--skip-chars <N>β avoid comparing the first N characters βοΈ skip past the intro, get to the real content-f,--skip-fields <N>β avoid comparing the first N fields π« same energy but for whole fields, periodt-u,--uniqueβ only print unique lines β the solo girlies, the ones with no duplicate-z,--zero-terminatedβ end lines with0byte, not newline π yes really, null bytes, for the script girlies who need it-h,--helpβ Print help π«Ά she's helping-V,--versionβ Print version π·οΈ she's telling you who she is
β¨ EXTRA β¨
filter adjacent matching lines from INPUT (or standard input), writing to OUTPUT (or standard output). classic filter behaviour, no notes. π
β οΈ Note:uniqdoes not detect repeated lines unless they are adjacent. so if your duplicates are scattered all over the place, she literally cannot see them, bestie, that's not a bug that's just how she's built. π you may want tosortthe input first, or usesort -uwithoutuniq.
that last bit is important!! if your file is messy, uniq will gaslight you into thinking there are no duplicates. sort first. iykyk. π₯
β¨ VERSION β¨
v(uutils coreutils) 0.7.0 β that's the version tag, screenshot it, remember it. π
and that's the whole page, bestie!! uniq (uutils coreutils) 0.7.0 β she's from the General Commands Manual section, dated uniq(1) era, and she ate. no crumbs. go forth and deduplicate responsibly, ily, mwah π¦πβ¨
π¦ where this page comes from
- epel 10: rust-coreutils-devel 0.7.0-10.el10_3 Β· MIT
- epel 10: uutils-coreutils 0.7.0-10.el10_3 Β· (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND Zlib AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT AND (MIT OR Zlib OR Apache-2.0) AND (MIT-0 OR Apache-2.0) AND Unicode-3.0 AND (Unlicense OR MIT)
- fedora 43: rust-coreutils-devel 0.7.0-12.fc43 Β· MIT
- fedora 43: uutils-coreutils 0.7.0-12.fc43 Β· (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND Zlib AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT AND (MIT OR Zlib OR Apache-2.0) AND (MIT-0 OR Apache-2.0) AND Unicode-3.0 AND (Unlicense OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms