Skip to content

A simple Unix/Linux command-line shell written in C.

GoTouchGra55/C-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shaurya Tamang's Mini Shell

A simple Unix/Linux command-line shell written in C. It demonstrates core concepts of shell programming, including process creation, execution, built-in commands, and token parsing.


Features

  • Execute external programs using fork() and execvp().
  • Supports built-in commands:
    • cd – change directory
    • help – display built-in commands
    • exit – exit the shell
  • Tokenizes user input into commands and arguments.
  • Handles basic error cases (invalid commands, chdir errors, memory allocation errors).

Requirements

  • GCC or any C compiler
  • Unix/Linux operating system

Installation

  1. Clone or download the repository.
  2. Compile using GCC:
gcc main.c utils.c -o main
  1. Run the shell:
./main

Usage

$ help
$ cd /path/to/directory
$ ls -l
$ exit
  • Type commands like in a normal terminal.
  • Built-in commands (cd, help, exit) are handled internally.

Author

Shaurya Tamang – Built this shell as a learning project to understand processes, memory management, and function pointers in C.

About

A simple Unix/Linux command-line shell written in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages