Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

README.md[Uploading README.# Mini Shell Project

This is a simple command line shell that I built in C as a personal project. It works on Unix systems and lets me run commands, navigate directories, and chain programs together using pipes. The goal of this project is to understand how a shell works under the hood and practice systems programming in C.

Features

  • Run normal commands like ls, pwd, or any program installed on the system.

  • Built-in commands:

    • cd to change directories
    • exit to quit the shell
  • Supports pipes so I can connect commands, for example:

    ls | grep src

    echo hello | wc -c

  • Handles quoted strings and escaped spaces, so commands like this work:

    cd "My Project Folder"

    echo hello\ world

How to Compile and Run

  1. Clone the repository:
git clone <your-repo-url>
cd Mini\ Shell\ Project
  1. Build the shell using make:
make
  1. Run the shell:
./mini-shell
  1. Use it like a normal shell:
mini-shell> ls
mini-shell> cd src
mini-shell> echo hello | wc -c
mini-shell> exit

Project Structure

Mini Shell Project/
├── include/         # header files
│   └── shell.h
├── src/             # source code files
│   ├── main.c
│   ├── parser.c
│   ├── executor.c
│   └── builtins.c
├── Makefile
└── README.md

What I Learned

Through this project, I learned:

How a shell interprets commands and arguments. How to use fork, execvp, and pipe to run programs and connect their input/output. How to handle quoting, escaped characters, and pipes in a simple parser. How to structure a C project with multiple files and headers.

This project is now a working mini-shell, and I plan to expand it in the future with more features like file redirection and multiple built-in commands. md…]()

About

Representation of a Mini Shell in C that can be used in Unix.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages