Skip to content

Latest commit

 

History

461 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

GoReportCard GitHub Actions CI Status GitHub Actions CodeQL Status

Usage demoInstallationCommand-line completionUsageContributingLicense


uc is a simple utility for counting unique lines.

Usage demo

demo

Benchmarks

$ wc -l data.txt
18408096 data.txt

$ hyperfine 'sort -u data.txt | wc -l' 'uc -np data.txt'
Benchmark 1: sort -u data.txt | wc -l
  Time (mean ± σ):     16.030 s ±  0.181 s    [User: 86.713 s, System: 1.165 s]
  Range (min … max):   15.699 s … 16.324 s    10 runs

Benchmark 2: uc -np data.txt
  Time (mean ± σ):      2.889 s ±  0.101 s    [User: 2.435 s, System: 0.454 s]
  Range (min … max):    2.721 s …  3.065 s    10 runs

Summary
  uc -np data.txt ran
    5.55 ± 0.20 times faster than sort -u data.txt | wc -l

Installation

From sources

To build the uc from scratch, make sure you have a working Go 1.24+ (instructions), then:

go install github.com/essentialkaos/uc@latest
sudo dnf install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm
sudo dnf install uc

Prebuilt binaries

You can download prebuilt binaries for Linux from EK Apps Repository.

To install the latest prebuilt version, do:

bash <(curl -fsSL https://apps.kaos.st/get) uc

Upgrading

Since version 3.1.0 you can update uc to the latest release using self-update feature:

uc --update

This command will runs a self-update in interactive mode. If you want to run a quiet update (no output), use the following command:

uc --update=quiet

Note

Please note that the self-update feature only works with binaries that are downloaded from the EK Apps Repository. Binaries from packages do not have a self-update feature and must be upgraded via the package manager.

Command-line completion

You can generate completion for bash, zsh or fish shell.

Bash:

uc --completion=bash | sudo tee /etc/bash_completion.d/uc > /dev/null

ZSH:

uc --completion=zsh | sudo tee /usr/share/zsh/site-functions/uc > /dev/null

Fish:

uc --completion=fish | sudo tee /usr/share/fish/vendor_completions.d/uc.fish > /dev/null

Man documentation

You can generate man page for uc using next command:

uc --generate-man | sudo gzip > /usr/share/man/man1/uc.1.gz

Usage

Build Status

Branch Status
master CI
develop CI

Contributing

Before contributing to this project please read our Contributing Guidelines.

License

Apache License, Version 2.0

About

Simple utility for counting unique lines

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages