Skip to content

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.

License

Notifications You must be signed in to change notification settings

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

No packages published

Languages