π¨βπ» Omar Ait Benhammou π¨βπ» Oussama Benali π¨βπ» Mohamed El-Fihry π¨βπ» Ibrahim El Harraq
Weβre still actively developing and improving 0-shell.
Our team is continuously refining command handling, optimizing performance, and adding new features such as better error handling, I/O redirection, and enhanced piping support.
Stay tuned β future updates will bring more stability, usability, and functionality!
0-shell is a minimalist Unix-like shell implemented entirely in Rust, designed to run on Unix systems without depending on existing shells (like bash or sh) or external binaries.
Our shell handles core file system operations, process control, and command execution using Rustβs system-level abstractions, ensuring safety, robustness, and efficiency β ideal for embedded Linux or lightweight system environments.
Each command is written from scratch using Rustβs standard library and low-level system calls:
| Command | Description | Supported Options |
|---|---|---|
echo |
Prints text to standard output | β |
cd |
Changes the current working directory | β |
pwd |
Prints the current working directory | β |
ls |
Lists directory contents | -l, -a, -F |
cat |
Displays file contents | β |
cp |
Copies files | β |
mv |
Moves or renames files | β |
rm |
Removes files or directories | -r |
mkdir |
Creates directories | β |
exit |
Exits the shell | β |
We implemented command piping, allowing output from one command to serve as input to another.
$ echo "hello world" | cat
hello worldOur shell uses inter-process communication (IPC) via Unix pipes and Rustβs std::os::unix::io API to connect child processes efficiently.
Through this project, we learned how to:
- Use system calls for file and process management in Rust
- Manage user input and shell loops
- Handle process creation and synchronization (
fork,exec, etc.) - Implement error handling and graceful exit on EOF (
Ctrl+D) - Explore Unix design principles and shell behavior
makemake run$ pwd
/home/student
$ mkdir test && cd test
$ echo "Rust is fast!" > file.txt
$ cat file.txt
Rust is fast!
$ ls -l
-rw-r--r-- 1 user user 13 Nov 12 15:30 file.txt
$ echo "piping works" | cat
piping works
$ exitUnrecognized commands are handled gracefully:
$ something
Command 'something' not foundPressing Ctrl+D exits the shell without crashing.
Potential enhancements include:
- Auto-completion for commands and paths
- Command history
- Environment variables (
$HOME,$PATH) - Colorized prompt and output
- I/O redirection (
>,<) - Command chaining (
;)
- Language: Rust
- System API: POSIX (via
std::os::unixandnixcrate equivalents if used) - Memory Safety: Fully guaranteed by Rust ownership model
- Platform: Linux / Unix-based systems
π 0-shell on Zone01 Oujda Git
This project is developed for educational purposes as part of the Zone01 Oujda curriculum. All contributors hold equal ownership of the code.