Minishell is a simple shell implementation written in C. It provides a lightweight command-line interface that allows users to execute commands, manage processes, and navigate the file system. This project serves as an educational tool for understanding shell concepts, process management, and system calls in Unix-like operating systems.
- Command Execution: Execute built-in and external commands.
- Environment Variable Management: Set, get, and unset environment variables.
- Input/Output Redirection: Support for redirecting input and output using
>
,<
, and>>
. - Piping: Ability to pipe the output of one command to the input of another using
|
. - Custom Built-in Commands: Includes basic built-in commands like
cd
,env
,pwd
,export
,unset
andexit
.
To build and run Minishell, you will need:
- A C compiler (e.g., gcc)
- Basic understanding of C programming and Unix/Linux shell concepts
-
Clone the Repository:
git clone https://github.com/yourusername/minishell.git cd minishell
-
Build the Project:
make
-
Run the Shell:
./minishell
Once the shell is running, you can enter commands directly into the command line interface.
Here are some examples of commands you can use:
-
Change Directory:
cd /path/to/directory
-
List Files:
ls -l
-
Print Environment Variables:
env
-
Redirect Output:
echo "Hello World" > output.txt
-
Pipe Commands:
ls -l | grep ".c"
Minishell supports several built-in commands:
cd [directory]
: Change the current directory.exit
: Exit the shell.env
: Display the current environment variables.
Contributions are welcome! If you would like to contribute to this project, please fork the repository and submit a pull request. Any feedback or suggestions for improvement are also appreciated.
For questions or feedback, please open an issue in the GitHub repository.