Removes duplicates while keeping the original order — which is the difference between this and piping through sort -u, and it matters when the order carries meaning.
Three different questions
Deduplicated list — every distinct line, once. The usual job: cleaning an email list, a set of IDs, a log of URLs.
Only lines that repeat — the answer to "what is duplicated in here?", which is a different question and one that a deduplicating tool cannot answer.
Only lines that appear once — the answer to "what is in one list and not the other?" when you have concatenated two lists. Combined with case-insensitivity this catches near-duplicates that a naive comparison misses.
Case and whitespace
ADA@EXAMPLE.COM and ada@example.com are the same address and treating them as different is how a "deduplicated" mailing list still sends two copies. The output preserves the original text of whichever occurrence was kept.Which copy survives, and why order is kept
sort | uniq, which only works because sorting brings duplicates next to each other and destroys the original order as a side effect. Keeping position matters when the order carries meaning — a log, a playlist, a list of steps — and it is the reason a file that was already sorted comes out looking untouched apart from the removals.Other names for this
Also searched as “dedupe lines”, “delete duplicate lines”, “unique lines”.
Questions
- Does it sort the lines?
- No. The original order is preserved, unlike sort -u.
- Are “Apple” and “apple” the same line?
- By default yes. Turn on “Case-sensitive” to treat them as different.
- Does my text leave the browser?
- No. Everything runs as JavaScript in this tab — there is no server involved and no request is made. Open the Network panel and watch, or turn your Wi-Fi off and keep using the tool.