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