Skip to content

guuzaa/coreutils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coreutils Implementation

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.

Implemented Utilities

  • wc: Word, line, and byte counting utility
  • true: Do nothing, successfully (exit with status 0)
  • false: Do nothing, unsuccessfully (exit with status 1)

Planned Utilities

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...

Installation

Prerequisites

  • Zig compiler (0.14 recommended)

Building from Source

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/.

Usage

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

Contributing

Contributions are welcome! Feel free to:

  • Implement new utilities
  • Improve existing implementations
  • Report bugs
  • Suggest enhancements

License

Licensed under Apache-2.0 license (LICENSE or http://opensource.org/licenses/Apache-2.0)

About

A project to implement GNU coreutils in C++ and Zig.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published