Skip to content

hilbigan/distr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

distr

Prints a histogram of lines read via stdin, equivalent to sort | uniq -c | sort -n, but better.

Examples

Simple example:

$ cat test
a
a
a
b
b
c
a
$ cat test | distr
1 ( 14.29%) c
2 ( 28.57%) b
4 ( 57.14%) a
- --------- ---
7 (100.00%) total, 3 buckets

Distribution of file extensions in ~/git:

$ find ~/git/ -iname "*.*" | sed -E "s/.*\.([^ ]+)\$/\1/g" | distr
[...]
 2619 (  3.49%) map
 2633 (  3.50%) c
 2673 (  3.56%) d
 3063 (  4.08%) timestamp
 3958 (  5.27%) ts
 5418 (  7.21%) json
 6266 (  8.34%) o
 8245 ( 10.98%) jpg
15263 ( 20.32%) js
----- --------- ---
75123 (100.00%) total, 398 buckets

Install

make install

About

sort | uniq -c | sort -n, but better

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published