Skip to content

rynhndrcksn/gwc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gwc

A Golang implementation of the Unix wc utility. Counts lines, words, bytes, and characters in one or more files, or from stdin.

Usage

gwc [OPTIONS] [FILES]...

Options

Flag Description
-l, --lines Print the line count
-w, --words Print the word count
-c, --bytes Print the byte count
-m, --chars Print the character count

If no flags are provided, -l, -w, and -c are enabled by default — matching the behavior of wc.

Input

From files:

gwc file.txt
gwc -l -w file1.txt file2.txt

From stdin:

echo "hello world" | gwc
cat file.txt | gwc -l

If neither files nor stdin input are provided, the program will exit with an error.

Example Output

$ echo "hello world" | gwc
stdin: Byte count: 12
stdin: Line count: 1
stdin: Word count: 2

Building

Requires Golang.

make build

The compiled binary will be at ./bin/rwc.

Contributing

If you see a problem or improvement that can be made, please open up an issue to discuss it.

License

Copyright© 2026 Ryan Hendrickson. Released under the MIT License. See LICENSE for details.

About

Go implementation of `wc`.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors