In this project, you’ll build 0-shell, a minimalist Unix-like shell implemented in Rust, designed to run core Unix commands using system calls—without relying on external binaries or built-in shells like bash
or sh
.
Inspired by tools like BusyBox, this project introduces you to key concepts in Unix system programming, including process creation, command execution, and file system interaction, all while leveraging Rust’s safety and abstraction features to avoid manual memory management.
You are a system-level developer assigned to build a lightweight, standalone Unix shell for an embedded Linux environment. Your task is to create a shell that handles basic navigation, file manipulation, and process control—faithfully mimicking essential shell behaviors without relying on existing shell utilities.
Your minimalist shell must:
$
) and wait for user inputCtrl+D
(EOF) gracefully to exit the shellYou must implement the following commands from scratch, using system-level Rust abstractions:
echo
cd
ls
(supporting -l
, -a
, -F
)pwd
cat
cp
rm
(supporting -r
)mv
mkdir
exit
Additional constraints:
Command '<name>' not found
|
, no redirection >
, no globbing *
, etc.)Implementing any of the following will be considered bonus:
Ctrl+C
(SIGINT) without crashing the shell~/projects/0-shell $
);
|
)>
, <
)$HOME
, $PATH
)help
command documenting built-in functionalitystudent$ ./0-shell
$ cd dev
$ pwd
/dev
$ ls -l
total 0
crw------- 1 root root 10, 58 Feb 5 09:21 acpi_thermal_rel
crw-r--r-- 1 root root 10, 235 Feb 5 09:21 autofs
drwxr-xr-x 2 root root 540 Feb 5 09:21 block
...
$ something
Command 'something' not found
$ echo "Hello There"
Hello There
$ exit
student$
This project will be reviewed and graded based on the following:
man 2 open
, man 2 execve
)