{"id":22180649,"url":"https://github.com/jftuga/freq","last_synced_at":"2025-07-26T17:32:20.542Z","repository":{"id":57624087,"uuid":"157751025","full_name":"jftuga/freq","owner":"jftuga","description":"Display the frequency of each line in a file or from STDIN","archived":false,"fork":false,"pushed_at":"2023-11-24T21:57:56.000Z","size":41,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T14:20:37.234Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jftuga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-15T17:54:09.000Z","updated_at":"2023-11-24T21:54:54.000Z","dependencies_parsed_at":"2024-06-20T14:12:58.940Z","dependency_job_id":null,"html_url":"https://github.com/jftuga/freq","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Ffreq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Ffreq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Ffreq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Ffreq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jftuga","download_url":"https://codeload.github.com/jftuga/freq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227700379,"owners_count":17806365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T09:18:59.600Z","updated_at":"2024-12-02T09:19:00.337Z","avatar_url":"https://github.com/jftuga.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# freq\n\nDisplay the line frequency of each line in a file or from STDIN\n\nThe [Releases Page](https://github.com/jftuga/freq/releases) contains binaries for Windows, MacOS, Linux and FreeBSD.\n\n## Usage\n\n```\nUsage for freq:\n  -N int\n    \tonly output the last N results, useful with -a\n  -a\toutput results in ascending order\n  -b\tbare: don't display numeric frequencies; only display a sorted, unique list\n  -d\tif line only contains IP address, resolve to hostname\n  -l\tconvert to lowercase first\n  -n int\n    \tonly output the first N results\n  -p\toutput using percentages\n  -se int\n    \tsubstring end position\n  -ss int\n    \tsubstring start position\n  -v\tdisplay version and then exit\n```\n\n## Installation\n\n* macOS: `brew update; brew install jftuga/tap/freq`\n* Binaries for Linux, macOS and Windows are provided in the [releases](https://github.com/jftuga/freq/releases) section.\n\n## Examples\n\n```\nR:\\freq\u003etype con \u003e test.txt\nd\nb\na\nb\nc\nc\nd\nc\nd\nd\n^Z\n\nR:\\freq\u003etype test.txt | freq.exe\n      4 d\n      3 c\n      2 b\n      1 a\n\nme@linux:~/freq$ freq -n 2 test.txt\n      4 d\n      3 c\n\nme@linux:~/freq$ ls -l | grep -v ^total ; echo ; ls -l | grep -v ^total | freq -ss 2 -se 6\n-rw-r--r-- 1 jftuga jftuga    1068 Feb  2 20:33 LICENSE\n-rw-r--r-- 1 jftuga jftuga     214 Feb  2 20:33 Makefile\n-rw-r--r-- 1 jftuga jftuga    1292 Feb  2 20:41 README.md\ndrwxr-xr-x 9 jftuga jftuga    4096 Feb  2 20:37 dist\n-rwxr-xr-x 1 jftuga jftuga 2398016 Feb  2 20:43 freq\n-rw-rw-r-- 1 jftuga jftuga    7654 Feb  2 20:33 freq.go\n-rwxr-xr-x 1 jftuga jftuga    3597 Feb  2 20:33 increment_version.sh\n\n      3\trw-r-\n      3\trwxr-\n      1\trw-rw\n```\n\n## Speed\n\nFor input greater than a few hundred megs in size, `freq` is faster than:\n\n    sort | uniq -c | sort -nr\n    # or\n    awk '{a[$0]++}END{for(i in a){print a[i] \" \" i}}' | sort -nr\n    \nbut slower than something like:\n\n    export LC_ALL=C\n    sort -S 8G --parallel=4 -T /mnt/fast_ssd/tmp | uniq -c | sort -n -r -S 8G --parallel=4 -T /mnt/fast_ssd/tmp\n    \nSee also:  https://www.reddit.com/r/commandline/comments/a7hq5n/psa_improving_gnu_sort_speed/\n\n## Compile with Docker\n\n* see also: https://hub.docker.com/_/golang\n* docker pull golang\n* git clone https://github.com/jftuga/freq.git\n* cd freq\n* docker run --rm -v \"$PWD\":/usr/src/freq -w /usr/src/freq golang:latest make \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjftuga%2Ffreq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjftuga%2Ffreq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjftuga%2Ffreq/lists"}