An Elixir implementation of the Unix wc command line utility
Find a file
Sven Van Caekenberghe 81f57c924c
All checks were successful
Elixir CI / Build and test (push) Successful in 2m11s
ignore escript binary /wc
2026-06-01 16:56:23 +02:00
.forgejo/workflows ci: add format check, compile warnings, escript build steps 2026-06-01 16:53:28 +02:00
lib implement wc — Elixir port of Unix word count utility 2026-06-01 16:44:30 +02:00
test implement wc — Elixir port of Unix word count utility 2026-06-01 16:44:30 +02:00
.formatter.exs mix new . --app wc --module WC 2026-06-01 16:24:30 +02:00
.gitignore ignore escript binary /wc 2026-06-01 16:56:23 +02:00
AGENTS.md add AGENTS.md with build/test/CI commands and project layout 2026-06-01 16:56:00 +02:00
LICENSE Initial commit 2026-06-01 14:17:06 +00:00
mix.exs implement wc — Elixir port of Unix word count utility 2026-06-01 16:44:30 +02:00
README.md implement wc — Elixir port of Unix word count utility 2026-06-01 16:44:30 +02:00

wcx

An Elixir implementation of the Unix wc command line utility.

Build

mix escript.build

This produces a wc binary in the project root.

Usage

./wc [OPTION]... [FILE]...

Read from stdin when no files are given:

echo "hello world" | ./wc

Options

Flag Long Description
-l --lines print the newline counts
-w --words print the word counts
-c --bytes print the byte counts
-m --chars print the character counts
-L --longest print the longest line length
-h --help display help and exit

Default (no flags) is equivalent to -lwc.

Reference

https://en.wikipedia.org/wiki/Wc_(Unix)