Skip to content

sandyandoss/SimpleShell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖥️ Java Shell – Command Line Interpreter

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.


📌 Project Overview

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 using ProcessBuilder)
  • 🔄 Input/Output Redirection
  • 🔧 Pipe Handling
  • 📂 Directory Management
  • 🧵 Process Synchronization (waitFor())

🚀 Features

✅ 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

🧑‍💻 Usage

▶️ Running the Shell

javac MyShell.java CommandExecutor.java
java MyShell

About

Java SmallShell is a simple Windows shell built in Java. Supports command execution, cd, redirection (>, <), and single piping (|). Built with ProcessBuilder to explore OS concepts like process creation and I/O. Works on CMD, PowerShell, and Git Bash.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages