guuzaa/coreutils
A project to implement GNU coreutils in C++ and Zig.
1a71188d1816cc0741785d4694f790a1106a150a.tar.gz
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:
ls
, cp
, mv
, rm
, mkdir
, cat
, etc.head
, tail
, sort
, uniq
, etc.pwd
, whoami
, uname
, etc.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/
.
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:
Licensed under Apache-2.0 license (LICENSE or http://opensource.org/licenses/Apache-2.0)