A custom Unix shell built from scratch in C, running on Linux/WSL.
- Interactive prompt (REPL loop)
- Execute real Linux commands (
ls,pwd,echo,mkdiretc.) - Built-in
cdcommand - Argument parsing with
strtok() - Process management with
fork(),execvp(),wait()
gcc shell.c -o shell
./shellmyshell> ls
myshell> pwd
myshell> echo Hello World
myshell> cd /home
myshell> exit
- How shells work under the hood
- Linux system calls (
fork,exec,wait,chdir) - Process creation and management
- Input parsing in C
- Pipes support (
ls | grep txt) - I/O Redirection (
echo hello > file.txt) - Command history (arrow keys)
- Custom prompt with current directory
-
~expansion in paths
- Language: C
- Environment: Ubuntu 22.04 (WSL2)
- Compiler: GCC 11.4