UNIQ(1)
π 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.HIandhi? 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 π¦
uniqdoes 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 usesort -uwithoutuniq. no cap. π
π AUTHOR π
Written by Richard M. Stallman and David MacKenzie. (legends, fr fr π)
π’ REPORTING BUGS π’
found a bug? spill it:
- Report bugs to:
bug-coreutils@gnu.org - GNU coreutils home page: <https://www.gnu.org/software/coreutils/>
- General help using GNU software: <https://www.gnu.org/gethelp/>
- Report any translation bugs to <https://translationproject.org/team/>
π SEE ALSO π
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
- ubuntu stonking: gnu-coreutils 9.10-1ubuntu2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms