42 project minishell
A simple Unix shell implemented in C, designed as a project to understand and practice basic shell functionalities such as parsing commands, managing environment variables, handling redirections, and implementing built-in commands.
minishell is a minimalistic command-line shell that replicates a subset of common shell features. This project is an educational exercise to deepen knowledge of process control, parsing, and system calls in Unix-based systems.
- Execute external commands with arguments
- Built-in commands:
cd,echo,env,exit,pwd,export,unset - Environment variable management
- Input/output redirection (
>,<,>>) - Command pipelines (
|) - Signal handling (e.g., Ctrl-C to interrupt)
- Proper error handling and exit statuses
- Unix-like operating system (Linux, macOS)
- GCC compiler (or compatible C compiler)
- Make utility
-
Clone the repository:
git clone https://github.com/JohannaGcd/minishell.git cd minishell -
Compile the project using
make:make
-
Run the shell:
./minishell
Once running, you can enter commands just like in a regular shell.
Examples:
$ echo Hello, minishell!
Hello, minishell!
$ cd ..
$ pwd
/home/user
$ ls -l | grep minishell
-rwxr-xr-x 1 user user 12345 Jun 10 2025 minishellTo exit the shell, use the exit command or press Ctrl-D.
src/- Source code files implementing the shellincludes/- Header filesMakefile- Build configuration.gitignore- Ignored files for Git
This project is primarily for educational purposes. Feel free to fork and experiment with improvements or additional features.
This project is licensed under the MIT License.
Inspired by basic shell design principles and implemented as part of 42 coding curriculum.