https://github.com/raresracsan/cpp-shell
Linux Shell in c++
https://github.com/raresracsan/cpp-shell
cpp linux-shell terminal
Last synced: about 2 months ago
JSON representation
Linux Shell in c++
- Host: GitHub
- URL: https://github.com/raresracsan/cpp-shell
- Owner: RaresRacsan
- Created: 2024-07-11T08:49:32.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-18T11:28:11.000Z (almost 2 years ago)
- Last Synced: 2025-04-03T18:37:16.010Z (about 1 year ago)
- Topics: cpp, linux-shell, terminal
- Language: C++
- Homepage:
- Size: 19.6 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MyShell
It is a simple Unix-like shell implemented in C++. It supports several built-in commands and provides basic file and process management functionalities. This project serves as a learning tool for understanding how command-line interpreters work.
## Features
- Built-in Commands: Supports common shell commands such as cd, ls, cp, rm, echo, mkdir, and more.
- File Operations: Provides file manipulation commands like cat, head, tail, sort, and cp.
- Process Management: Includes commands like ping and exit.
- Error Handling: Basic error handling for incorrect usage of commands.
## Commands
Here is a list of supported built-in commands:
- cd : Change the current directory.
- help: Display information about built-in commands.
- exit: Exit the shell.
- ls: List files in the current directory.
- echo : Print a message to the terminal.
- touch : Create a new file.
- rm : Remove a file.
- ping : Ping a host.
- pwd: Print the current working directory.
- mkdir : Create a new directory.
- cat : Display the contents of a file.
- cp : Copy a file.
- head : Display the first few lines of a file.
- tail : Display the last few lines of a file.
- sort : Sort the contents of a file and display the sorted lines.
## How to Use
Compile: Compile the project using a C++ compiler.
```sh
g++ MyShell.cpp functions.cpp -o myshell
```
Run: Execute the compiled binary:
```sh
./myshell
```
Interact: Use the supported commands in the shell prompt (>>).