___ _ _ _
/ _ \ ___ | |__ ___| | |
| | | |/ _ \| '_ \ / _ \ | |
| |_| | (_) | | | | __/ | |
\___/ \___/|_| |_|\___|_|_|
0-shell
A minimalist Unix-like shell written from scratch in Rust.
πΉ Custom Tokenizer
- Correctly handles spaces, quotes, and escaped characters.
πΉ Interactive Command Loop
$prompt- Multi-line input
- Graceful exit with
Ctrl+D
πΉ File System Utilities (implemented with Rustβs standard library):
| Command | Description | Flags / Notes |
|---|---|---|
echo |
Prints arguments | -n (no newline) |
pwd |
Shows current directory | β |
cd |
Changes directory | ~ (home), - (previous) |
ls |
Lists directory contents | -l, -a, -F |
cat |
Concatenates & prints files | Reads from stdin |
mkdir |
Creates directories | β |
cp |
Copies files & dirs | β |
rm |
Removes files | -r (directory) |
mv |
Moves or renames | β |
Clone the repo and start the shell:
git clone https://learn.zone01oujda.ma/git/mdinani/0-shell.git
cd 0-shell
cargo runYouβll see:
$Now you can run your commands π
β
Learn how shells work under the hood
β
Practice Rust systems programming
β
Explore tokenization, parsing, and process management
PRs and suggestions are welcome! If you have ideas for new features, improvements, or documentation, feel free to open an issue.