An open API service indexing awesome lists of open source software.

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++

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 (>>).