Use when turning repeated nonblank text lines into a frequency-ranked table, with counts sorted descending after case-insensitive grouping.
Extension of sort-uniq-count. It builds the same intermediate count<TAB>value table, then sorts the result by count descending and by value using the same compact flag bundle.
... | sort-uniq-count-rank [bfinrs]/home/vimalinx/miniforge3/envs/bio/bin/sort-uniq-count-rank-k 1,1nrsort-uniq-count# Ranked frequency table
printf 'beta\nAlpha\nalpha\nbeta\n' | sort-uniq-count-rank
# Reverse secondary ordering
printf 'a\na\nb\n' | sort-uniq-count-rank r
# Keep only the most frequent rows
cat values.txt | sort-uniq-count-rank | head
sort-uniq-count first.bfinrs) if you need to alter the secondary sort behavior.sort-uniq-count, this wrapper is case-insensitive because it always uses uniq -i -c.-h and --version are not metadata paths; they are mangled into downstream sort options. Locally, -h failed with sort: stray character in field spec: invalid field specification '2s'.sort -t '\t' -k 1,1nr -k "2$flags", so the first column is always descending numeric count and the second-column behavior depends on the derived flag bundle.printf 'beta\nAlpha\nalpha\nbeta\n' | sort-uniq-count-rank emitted the same two rows as the unranked wrapper because both counts were tied at 2.