I have a large text file with a lot of lines of terms. Some lines repeat themselves. I want a program that gives me the lines that appear most often in the entire document.

1 Answer 1


On linux the command can read: sort <filename> | uniq -c

Missed the Windows part at first. On Windows the same can be accomplished when e.g. Cygwin has been installed or the sort and uniq from the GNU collection are installed.

  • The question is NOT tagged with Linux, it is with "Windows" instead ... Commented Oct 4, 2017 at 13:33
  • I can do that on Linux as well through a VM, thanks. Commented Oct 4, 2017 at 14:03
  • 1
    @Pierre.Vriens there are also the Gnu32 CoreUtils for Windows which include sort and uniq (hm, a little dated – but there might be a newer fork available somewhere), there's Bash in Windows 10, there's gow, busybox-w32 and there's Cygwin and CygwinPortable. Oh, and there's MobaXterm of course :)
    – Izzy
    Commented Oct 4, 2017 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.