Welcome to SysForge, a challenge where you step into the shoes of a system explorer, diving deep into the broken-down world of Unix. The core command-line tools that once powered this world (ls, wc, cat, and grep) are gone.
Your mission: Rebuild them from scratch using C, and bring order back to the terminal!
Instead of just using these tools, you’ll create simplified versions of them, give them custom names, and make them work just like the originals.
Recreate the following core Unix commands with your own C programs:
| Custom Command | Original Equivalent | Description |
|---|---|---|
listit |
ls |
List files in a directory |
showtext |
cat |
Display contents of a file |
countit |
wc |
Count lines, words, and characters |
finder |
grep |
Search for text inside files |
Each command should be a separate executable and should work from the terminal just like real commands.
-a: Show all files, including hidden ones-1: List one file per line
-n: Number all lines-s: Squeeze multiple blank lines into one
-l: Count lines-w: Count words
-n: Show line numbers for matches-v: Show only non-matching lines
-
Each command must be implemented as a separate C file
-
Your commands must be runnable from anywhere in the terminal, like the original Unix tools.
-
Support for multiple files and combined flags is optional. You may choose to handle only one flag or file at a time for simplicity.
Along with your code, include a brief writeup for each command that covers:
- Your approach to building it
- Any challenges or bugs you encountered
- What you learned during the process
Happy forging, and may your terminal tools shine bright again!