{"id":13764166,"url":"https://github.com/timdp/lwc","last_synced_at":"2025-07-14T08:31:14.442Z","repository":{"id":57497066,"uuid":"130552847","full_name":"timdp/lwc","owner":"timdp","description":"A live-updating version of the UNIX wc command.","archived":false,"fork":false,"pushed_at":"2022-07-26T07:16:55.000Z","size":1469,"stargazers_count":32,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T04:14:44.634Z","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/timdp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"timdp"}},"created_at":"2018-04-22T09:23:44.000Z","updated_at":"2023-12-27T05:38:17.000Z","dependencies_parsed_at":"2022-09-03T23:51:01.500Z","dependency_job_id":null,"html_url":"https://github.com/timdp/lwc","commit_stats":null,"previous_names":["timdp/lwc-golang"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/timdp/lwc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timdp%2Flwc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timdp%2Flwc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timdp%2Flwc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timdp%2Flwc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timdp","download_url":"https://codeload.github.com/timdp/lwc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timdp%2Flwc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265262588,"owners_count":23736422,"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-08-03T15:01:17.310Z","updated_at":"2025-07-14T08:31:13.739Z","avatar_url":"https://github.com/timdp.png","language":"Go","readme":"# lwc\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/timdp/lwc)](https://goreportcard.com/report/github.com/timdp/lwc)\n[![Build Status](https://img.shields.io/circleci/project/github/timdp/lwc/master.svg)](https://circleci.com/gh/timdp/lwc)\n[![Coverage Status](https://img.shields.io/coveralls/timdp/lwc/master.svg)](https://coveralls.io/github/timdp/lwc)\n[![Release](https://img.shields.io/github/release/timdp/lwc.svg)](https://github.com/timdp/lwc/releases/latest)\n\nA live-updating version of the UNIX [`wc` command](https://linux.die.net/man/1/wc).\n\n![](demo.gif)\n\n## Installation\n\nYou can get a prebuilt binary for every major platform from the\n[Releases page](https://github.com/timdp/lwc/releases). Just extract it\nsomewhere under your `PATH` and you're good to go.\n\nAlternatively, use `go get` to build from source:\n\n```bash\ngo get -u github.com/timdp/lwc/cmd/lwc\n```\n\nOn Debian-compatible Linux distributions such as Ubuntu, you can also use the\n_experimental_ APT repository:\n\n```bash\necho 'deb [allow-insecure=yes] https://tmdpw.eu/lwc-releases/debian/ any main' |\n  sudo tee /etc/apt/sources.list.d/lwc.list\nsudo apt update\nsudo apt install lwc\n```\n\n## Usage\n\n```\nlwc [OPTION]... [FILE]...\nlwc [OPTION]... --files0-from=F\n```\n\nWithout any options, `lwc` will count the number of lines, words, and bytes\nin standard input, and write them to standard output. Contrary to `wc`, it will\nalso update standard output while it is still counting.\n\nAll the standard [`wc` options](https://linux.die.net/man/1/wc) are\nsupported:\n\n- `--lines` or `-l`\n- `--words` or `-w`\n- `--chars` or `-m`\n- `--bytes` or `-c`\n- `--max-line-length` or `-L`\n- `--files0-from=F`\n- `--help`\n- `--version`\n\nIn addition, the output update interval can be configured by passing either\n`--interval=TIME` or `-i TIME`, where `TIME` is a duration in milliseconds.\nThe default update interval is 100 ms.\n\n## Examples\n\nCount the number of lines in a big file:\n\n```bash\nlwc --lines big-file\n```\n\nRun a slow command and count the number of lines and words logged:\n\n```bash\nslow-command | lwc --lines --words\n```\n\nBenchmark `lwc`'s throughput by counting random bytes (press Ctrl+C to exit):\n\n```bash\nlwc --bytes \u003c /dev/urandom\n```\n\n## Caveats\n\nYou can _mostly_ use `lwc` as a drop-in replacement for `wc`. However, you\nshould be aware of the following:\n\n- The behavior of the `--words` and `--chars` options is slightly different\n  from `wc`'s implementation. You might get different values with certain\n  binary data.\n\n- While `lwc` is pretty fast, you won't get the same raw throughput as with\n  `wc`. The reason for that is (probably) twofold: the code isn't optimized for\n  performance, and a Go implementation is no match for a C one.\n\n## JavaScript Version\n\nThis utility briefly existed as a\n[Node.js package](https://github.com/timdp/lwc-nodejs). I'm keeping the code\naround for educational purposes, but I will no longer be maintaining it.\n\n## Author\n\n[Tim De Pauw](https://tmdpw.eu/)\n\n## License\n\nMIT\n","funding_links":["https://github.com/sponsors/timdp"],"categories":["DevOps Tools","Software Packages","软件包","Go Tools","Go 工具"],"sub_categories":["DevOps Tools","DevOps工具","DevOps 工具","代码分析","devops 工具"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimdp%2Flwc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimdp%2Flwc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimdp%2Flwc/lists"}