A simple, cross-platform shell (command-line interpreter) written in Java.
Supports command execution, cd navigation, input/output redirection (>, <), and single piping (|), all compatible with Windows CMD, PowerShell, and Git Bash.
This project simulates a Unix-style shell using Java. It allows users to execute shell commands, manage directories, and handle redirection and pipes—teaching core Operating System concepts like:
- 👶 Process Creation (
fork()+exec()equivalent usingProcessBuilder) - 🔄 Input/Output Redirection
- 🔧 Pipe Handling
- 📂 Directory Management
- 🧵 Process Synchronization (
waitFor())
✅ Custom prompt: mysh>
✅ Supports Windows commands like dir, type, echo, findstr
✅ cd command implemented manually
✅ Handles:
- Standard output redirection:
echo Hello > out.txt - Standard input redirection (limited):
somecommand < file.txt - Piping:
type file.txt | findstr Hello
javac MyShell.java CommandExecutor.java
java MyShell