0-Shell is a minimal Unix-like shell written in Rust. It mimics the behavior of sh and supports basic commands with a focus on learning system programming concepts, including file handling, metadata inspection, and process management.
- Execute standard shell commands:
echo,pwd,cd,ls,exit. lsimplementation mimics GNUls -alformatting:- Displays permissions, owner, group, size, modification time.
- Supports hidden files and symbolic links.
- Case-insensitive sorting, ignoring leading symbols for alphabetic order.
- Correctly handles
.and..entries.
- Safe printing to handle broken pipes (prevents panics).
- Simple command parsing with multi-line input support for quoted strings.
- Clone the repository:
git clone <repo_url>
cd zero-shell- Build and run the shell:
cargo run- Example commands:
~$ pwd
/home/user
~$ ls -al
drwxr-xr-x 5 user user 4096 Aug 27 12:09 .
drwxr-xr-x 23 user user 4096 Aug 25 13:00 ..
-rw-r--r-- 1 user user 0 Aug 26 17:50 example.txtsrc/main.rs— Entry point and main loop.src/lib.rs— Core functions (command handlers,ls, utilities).src/ls.rs— Implementation oflscommand, including metadata formatting and sorting.
- This shell is for learning purposes and does not support advanced shell features like piping, redirection, or background processes yet.
- The sorting logic in
lsis inspired by GNUlsand uses case-insensitive comparison and leading-symbol ignoring to approximate the correct order.
MIT License