https://github.com/ukhang/my-shell
This is a custom shell built in TypeScript that mimics a command-line interface.
https://github.com/ukhang/my-shell
custom-shell jest-test oop-principles shell typescript
Last synced: 9 days ago
JSON representation
This is a custom shell built in TypeScript that mimics a command-line interface.
- Host: GitHub
- URL: https://github.com/ukhang/my-shell
- Owner: Ukhang
- License: mit
- Created: 2025-03-03T08:38:16.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-11T07:54:45.000Z (about 1 year ago)
- Last Synced: 2025-03-11T08:28:45.298Z (about 1 year ago)
- Topics: custom-shell, jest-test, oop-principles, shell, typescript
- Language: TypeScript
- Homepage:
- Size: 49.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# My Shell
This is a custom shell built in TypeScript that mimics a command-line interface. It supports various built-in commands and allows users to navigate and interact with the filesystem efficiently.
## Features
### Core Features
- ✅ **exit** - Terminates the shell session.
- ✅ **echo [text]** - Prints the given text to the terminal.
- ✅ **pwd** - Displays the current working directory.
- ✅ **cd [directory]** - Changes the current directory to the specified path.
- ✅ **ls** - Lists the contents of the current directory.
- ✅ **touch [filename]** - Creates a new empty file with the given name.
- ✅ **cat [filename]** - Displays the contents of a file.
- ✅ **clear** - Clears the terminal screen.
### Navigation & File Management
- ✅ **mkdir [directory]** - Creates a new directory.
- ✅ **rmdir [directory]** - Removes an empty directory.
- ✅ **rm [filename]** - Deletes a file.
- ✅ **cp [source] [destination]** - Copies a file or directory.
- ✅ **mv [source] [destination]** - Moves or renames a file or directory.
### Process Management
- ✅ **ps** - Lists running processes.
- ✅ **kill [PID]** - Terminates a process.
- ✅ **jobs** - Lists background jobs.
- ✅ **fg [job ID]** - Brings a background job to the foreground.
- ✅ **bg [job ID]** - Resumes a stopped job in the background.
### Networking
- ✅ **ping [host]** - Pings a host to check connectivity.
- ✅ **curl [URL]** - Fetches content from a URL.
### Permissions
- ✅ **chmod [permissions] [file]** - Changes file permissions.
- ✅ **chown [owner] [file]** - Changes file ownership.
### Quoting
- ✅ **Single Quotes ('')** - Preserves literal value of all characters.
- ✅ **Double Quotes ("")** - Allows variable expansion (echo "$HOME").
- ✅ **Backslash () Outside Quotes** - Escapes special characters.
## Installation
1. Clone the repository:
```sh
git clone https://github.com/Ukhang/my-shell.git
cd my-shell
```
2. Install dependencies:
```sh
npm install
```
3. Run the shell:
```sh
npm run my-shell
```
## Usage
```sh
my-shell$ pwd
/home/user/my-shell
my-shell$ echo Hello, World!
Hello, World!
my-shell$ cd ..
Changed directory to /home/user
my-shell$ exit
Exiting shell...
```
## architecture diagram

## License
This project is licensed under the MIT License.