A basic shell that targets both Windows And Ubuntu written in C++ for COSC 439 - Operating Systems course.
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
The project is built using C++. To build the shell:
- Ensure you have a C++ compiler installed like g++
- Navigate to the project directory
- Compile the main file:
g++ 439shell.cpp -o 439shellRun the compiled shell:
./439shellThe shell will start with a prompt where you can enter commands.
>> [command] [arguments...]
You can also run individual commands directly from the command line without actually starting the shell.
./439shell [command] [arguments...]Example:
./439shell help
./439shell ls
./439shell mkdir new_directory
./439shell cat file.txtmkdir <directory>: Create a new directoryrmdir <directory>: Remove an empty directoryls: List directory contentspwd: Print current working directory
touch <file>: Create an empty file or update timestamprm <file>: Remove a filecp <source> <destination>: Copy filesmv <source> <destination>: Move or rename files
cat <file>: Display file contentswc <file>: Count lines, words, and charactersgrep <pattern> <file>: Search for text patterns
src/: Contains implementation files for each commandsrc/Windows/: Windows-specific command implementationssrc/Unix/: Unix-specific command implementationssrc/Models/: Shell model classes. Also holds functions that should work no matter the platform439shell.cpp: Main shell implementation
- C++11 or later
- Unix-like system (Linux, macOS, or WSL)
- Windows
- Standard C++ libraries