A minimalist Unix-like shell implemented entirely in Rust, designed to run core Unix commands using low-level system operations rather than external binaries or existing shells.
0-shell is a lightweight, standalone shell designed for embedded Linux environments. All supported commands are implemented from scratch using Rust and system-level operations.
-
Displays
$prompt -
Parses and executes commands synchronously
-
Exits gracefully on Ctrl+D (EOF)
-
Reports unknown commands with:
Command '<name>' not found
| Command | Description |
|---|---|
echo |
Print arguments |
cd |
Change directory |
ls |
List directory contents (-l, -a, -F) |
pwd |
Print current directory |
cat |
Output file contents |
cp |
Copy files |
rm |
Remove files/directories (-r) |
mv |
Move or rename files |
mkdir |
Create directories |
exit |
Exit the shell |
student$ ./0-shell
$ cd dev
$ pwd
/dev
$ ls -l
...
$ something
Command 'something' not found
$ echo "Hello There"
Hello There
$ exit
student$
- File and directory system operations
- Shell loop I/O handling
- Robust syscall error handling
- Unix process and system API fundamentals
cargo build --release./target/release/0-shellsrc/
main.rs
commands/
utils/