A project to implement GNU coreutils utilities in C++
and Zig
. This is an ongoing effort to recreate the essential Unix/Linux command-line tools.
wc
: Word, line, and byte counting utilitytrue
: Do nothing, successfully (exit with status 0)false
: Do nothing, unsuccessfully (exit with status 1)
The project aims to implement all core utilities, including but not limited to:
- File Management:
ls
,cp
,mv
,rm
,mkdir
,cat
, etc. - Text Processing:
head
,tail
,sort
,uniq
, etc. - System Information:
pwd
,whoami
,uname
, etc. - And many more...
- Zig compiler (0.14 recommended)
Clone the repository and build using Zig's build system:
git clone https://github.com/guuzaa/coreutils.git
cd coreutils
zig build
The executables will be available in zig-out/bin/
.
wc Examples
Count lines, words, and characters in a file:
wc file.txt
Count only lines in multiple files:
wc -l file1.txt file2.txt
Count words from standard input:
cat file.txt | wc -w
Contributions are welcome! Feel free to:
- Implement new utilities
- Improve existing implementations
- Report bugs
- Suggest enhancements
Licensed under Apache-2.0 license (LICENSE or http://opensource.org/licenses/Apache-2.0)