uniq(1)

πŸ“¦
version 0.7.0 Β· 4 versions
, in epel 10, fedora 43

πŸ’– 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:

  • none
  • prepend
  • separate
  • --group[=<group-method>] β€” show all items, separating groups with an empty line. [default: separate]

possible values:

  • separate
  • prepend
  • append
  • both
  • -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 πŸ™ˆ HELLO and hello are 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 with 0 byte, 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: uniq does 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 to sort the input first, or use sort -u without uniq.

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