https://github.com/bless-04/operating-system-shell
A basic operating system shell capable of executing commands and performing fundamental system operations effectively. Each command is directly integrated into the shell program. All functionalities are seamlessly integrated and executed within the shell itself.
https://github.com/bless-04/operating-system-shell
cpp cpp11 shell
Last synced: 11 months ago
JSON representation
A basic operating system shell capable of executing commands and performing fundamental system operations effectively. Each command is directly integrated into the shell program. All functionalities are seamlessly integrated and executed within the shell itself.
- Host: GitHub
- URL: https://github.com/bless-04/operating-system-shell
- Owner: Bless-04
- Archived: true
- Created: 2025-04-21T23:07:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-16T11:55:51.000Z (about 1 year ago)
- Last Synced: 2025-06-10T07:09:04.050Z (about 1 year ago)
- Topics: cpp, cpp11, shell
- Language: C++
- Homepage:
- Size: 434 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Operating System Shell
A basic shell that targets both Windows And Ubuntu written in C++ for COSC 439 - Operating Systems course.
## Features
This shell implements the following commands:
- **cd**: Change directory
- **clear**: Clear the terminal
- **environ**: Display environment variables
- **echo**: Display a line of text
- **help**: Display help information
- **pause**: Pause the shell
- **quit**: Quit the shell
- **ls**: List directory contents
- **pwd**: Print working directory
- **cat**: Display file contents
- **mkdir**: Create directories
- **rmdir**: Remove empty directories
- **rm**: Remove files
- **cp**: Copy files
- **mv**: Move/rename files
- **touch**: Create empty files or update timestamps
- **wc**: Word count (lines, words, characters)
- **grep**: Search text patterns in files
## Building the Project
The project is built using C++. To build the shell:
1. Ensure you have a C++ compiler installed like g++
2. Navigate to the project directory
3. Compile the main file:
```bash
g++ 439shell.cpp -o 439shell
```
## Usage
### Interactive Mode
Run the compiled shell:
```bash
./439shell
```
The shell will start with a prompt where you can enter commands.
```
>> [command] [arguments...]
```
### Command Line Mode
You can also run individual commands directly from the command line without actually starting the shell.
```bash
./439shell [command] [arguments...]
```
Example:
```bash
./439shell help
./439shell ls
./439shell mkdir new_directory
./439shell cat file.txt
```
## Command Reference
### Directory Operations
- `mkdir `: Create a new directory
- `rmdir `: Remove an empty directory
- `ls`: List directory contents
- `pwd`: Print current working directory
### File Operations
- `touch `: Create an empty file or update timestamp
- `rm `: Remove a file
- `cp `: Copy files
- `mv `: Move or rename files
### File Content Operations
- `cat `: Display file contents
- `wc `: Count lines, words, and characters
- `grep `: Search for text patterns
## Project Structure
- `src/`: Contains implementation files for each command
- `src/Windows/`: Windows-specific command implementations
- `src/Unix/`: Unix-specific command implementations
- `src/Models/`: Shell model classes. Also holds functions that should work no matter the platform
- `439shell.cpp`: Main shell implementation
## System Requirements
- C++11 or later
- Unix-like system (Linux, macOS, or WSL)
- Windows
- Standard C++ libraries