A collection of Linux command-line utilities reimplemented in Python. The goal of this project is to understand how common Unix tools work by recreating their core functionality from scratch using Python.
| Command | Description |
|---|---|
head | Display the first lines or bytes of a file. |
tail | Display the last lines or bytes of a file. |
wc | Count lines, words, bytes, and characters in files. |
More commands will be added over time.
.
├── exceptions/
├── head.py
├── tail.py
├── wc.py
└── README.md
- Learn how classic Unix utilities are implemented.
- Practice file I/O and stream processing.
- Improve Python programming skills.
python head.py <file>Display the first 10 lines (default):
python head.py example.txtpython wc.py <file>Examples:
python wc.py example.txtpython wc.py -lpython wc.py example.txt -c- Command-line interface
- Designed to closely match the behavior of the original Linux commands
catsortuniqgrepcuttrteepastenltacbasenamedirname
Reimplementing Unix tools is an excellent way to learn:
- Text processing
- File handling
- Standard input/output
- Command-line argument parsing
This project is licensed under the MIT License.