UNIQ(1)

πŸ“¦
version 9.10 Β· 5 versions
, in ubuntu stonking

πŸ’– UNIQ(1) β€” the girlies' guide to uniq πŸ’–

okay so bestie, you know when you have a file and it's just... the SAME line over and over and over? yeah. that's uniq's whole moment. it's a User Commands classic, from the GNU coreutils fam, and it is genuinely so useful once you get its vibe. it reports repeated lines, or omits them. your choice. iconic behaviour, honestly. ✨


🌸 NAME 🌸

uniq β€” report or omit repeated lines πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

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

✨ DESCRIPTION ✨

so the whole gig is: it filters adjacent matching lines from INPUT (or standard input if you don't give it anything, no pressure πŸ’…), and writes the result to OUTPUT (or standard output).

with no options at all? matching lines get merged down to the first occurrence. that's the default. that's her.

mandatory arguments to long options are mandatory for short options too. (yes that sentence is a ✨vibe✨ and yes it's also literally true, don't come for me.)

  • -c, --count β€” prefixes each line with how many times it showed up. a little number bestie, right there at the front πŸ“
  • -d, --repeated β€” only prints the duplicate lines, one per group. no singles allowed, this is couples-only πŸ’œ
  • -D β€” prints ALL the duplicate lines. every single one. she's thorough.
  • --all-repeated[=METHOD] β€” like -D, but it lets you separate the groups with an empty line; METHOD={none(default),prepend,separate}
  • -f, --skip-fields=N β€” don't compare the first N fields. skipping them, respectfully πŸ™ˆ
  • --group[=METHOD] β€” shows all the items, separating the groups with an empty line; METHOD={separate(default),prepend,append,both}
  • -i, --ignore-case β€” ignores differences in case when comparing. HI and hi? same thing, bestie, we don't play favourites ✨
  • -s, --skip-chars=N β€” don't compare the first N characters
  • -u, --unique β€” only prints the unique lines. the ones that stand alone. main character energy, no duplicates πŸ’…
  • -z, --zero-terminated β€” line delimiter is NUL, not newline
  • -w, --check-chars=N β€” compares no more than N characters in lines
  • --help β€” displays this help and exits πŸ‘‘
  • --version β€” outputs version information and exits

🧚 a lil definition for u 🧚

a field is a run of blanks (usually spaces and/or TABs), then non-blank characters. and heads up: fields are skipped before chars. order matters, periodt. ⭐


πŸ¦‹ the big warning πŸ¦‹

uniq does not detect repeated lines unless they are adjacent. like, she's not gonna hunt around your whole file for you, she only looks at neighbours. if you need that, you may want to sort the input first, or use sort -u without uniq. no cap. 😭

πŸ’œ AUTHOR πŸ’œ

Written by Richard M. Stallman and David MacKenzie. (legends, fr fr πŸ‘‘)


πŸ“’ REPORTING BUGS πŸ“’

found a bug? spill it:


🌈 SEE ALSO 🌈

comm(1), join(1), sort(1)

Full documentation <https://www.gnu.org/software/coreutils/uniq> or available locally via: info '(coreutils) uniq invocation'


Packaged by Ubuntu (9.10-1ubuntu2) Copyright Β© 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.


okay that's the whole thing bestie, you're officially a uniq girlie now 🫢 this was GNU coreutils 9.10, dated August 2026 β€” go forth and deduplicate, slay, mwah πŸ’–πŸŽ€

πŸ“¦ where this page comes from