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.
- ✅ 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.
- ✅ 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.
- ✅ 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.
- ✅ ping [host] - Pings a host to check connectivity.
- ✅ curl [URL] - Fetches content from a URL.
- ✅ chmod [permissions] [file] - Changes file permissions.
- ✅ chown [owner] [file] - Changes file ownership.
- ✅ Single Quotes ('') - Preserves literal value of all characters.
- ✅ Double Quotes ("") - Allows variable expansion (echo "$HOME").
- ✅ Backslash () Outside Quotes - Escapes special characters.
- Clone the repository:
git clone https://github.com/Ukhang/my-shell.git cd my-shell
- Install dependencies:
npm install
- Run the shell:
npm run my-shell
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...
This project is licensed under the MIT License.