/simple_shell

simple_shell is a command line interpreter, or shell, in the tradition of the first Unix shell written by Ken Thompson in 1971. This shell is intentionally minimalistic, yet includes the basic functionality of a traditional Unix-like command line user interface.

Primary LanguageC

Simple Shell

The Simple Shell is a basic command-line shell implemented in C. It provides users with a minimalistic command-line interface for running shell commands. This project was created as part of a learning exercise and serves as a simplified, educational example of how a shell can be implemented.

Authors

This simple shell project is a result of the collaboration Elmahdi Ratil and Younes Belaouad at ALX-SE Programme.

Features

  • Command Execution: The shell can execute various shell commands and external programs.

  • Change Directory (cd): Users can change their current working directory using the cd command.

  • Exit: The shell handles the exit command to terminate the shell.

  • Error Handling: The shell provides basic error handling for invalid commands and situations.

Getting Started

To get started with the Simple Shell, follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/Elmahdi-Ratil/simple_shell.git
  2. Compile the code:

    gcc -o hsh *.c
  3. Run the shell:

    ./hsh

Usage

The Simple Shell supports basic shell commands and external programs. Here are some examples of how to use the shell:

  • Running a command:

    '$ ls'
  • Changing directories (cd):

    '$ cd /path/to/directory'
  • Exiting the shell:

    '$ exit'

Please note that this is a minimal shell and does not support all the features of a full-featured shell like Bash.

Commands

The Simple Shell supports a variety of shell commands, including but not limited to:

  • ls: List files and directories in the current directory.
  • cd: Change the current working directory.
  • pwd: Print the current working directory.
  • echo: Print arguments to the standard output.
  • cat: Concatenate and display the content of files.
  • exit: Exit the shell.
  • ...