This is a simple UNIX-like shell implemented in C. The shell supports running Linux commands, I/O redirection, piping, command history, and signal handling.
- Display a shell prompt (
sh>
) and read user input - Execute Linux system commands using
fork
andexec
- Input (
<
) and output (>
,>>
) redirection - Command piping (
|
) – supports multiple pipes - Multiple commands in-line separated by (
;
) - Multiple commands in sequence using (
&&
) - Command history support (
history
command) - Signal handling – pressing
Ctrl+C
won’t terminate the shell, only the running process
- Command for Clone the repository
git clone https://github.com/MahirFaisal08/unix-shell-c.git cd unix-shell-c
- Command for Compile the shell
gcc unix-shell-c.c -o mysh
- Command for Run the shell
./mysh
sh> pwd /home/user/projects
sh> ls -l > files.txt
sh> cat files.txt | grep ".c"
sh> echo "Hello" >> output.txt
sh> history
- pwd
- ls -l > files.txt
- cat files.txt | grep ".c"
- echo "Hello" >> output.txt
- Basic shell functionality & built-in command support
- Input/output redirection (
<
,>
,>>
) - Command piping (
|
) - Signal handling (
Ctrl+C
) - Logical operators (
;
,&&
) - Command history support
- Add support for environment variables
- Implement tab auto-completion
- Add advanced error handling
- Improve history persistence (save across sessions)
- Mahir Faisal
- GitHub Profile
This project is licensed under the MIT License – you are free to use, modify, and distribute this software with proper credit.
For more details, see the LICENSE file in this repository or visit the official MIT License.
Contributions, issues, and feature requests are welcome!
If you’d like to contribute:
- Fork the repository
- Create a new branch (
git checkout -b feature-branch
) - Make your changes and commit (
git commit -m "Add new feature"
) - Push to your branch (
git push origin feature-branch
) - Open a Pull Request
Check the Issues page for open tasks or feature requests.