Skip to content

Ukhang/my-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terminal

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:
    git clone https://github.com/Ukhang/my-shell.git
    cd my-shell
  2. Install dependencies:
    npm install
  3. Run the shell:
    npm run my-shell

Usage

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

image 1

License

This project is licensed under the MIT License.

About

This is a custom shell built in TypeScript that mimics a command-line interface.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published