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