This project is a custom shell implementation in C, which provides a simplistic command line interface. It provides both built-in commands and system utility commands. The inspiration for this project arose from my interest in the Linux Operating System and, therefore, the Unix command line.
To build the project, run the build.sh
script (ensure you have a C compiler, like gcc
, installed):
./build.sh
./my_shell
- Built-in commands:
exit
: Exit the shellecho
: Print text to the consoletype
: Display information about command typepwd
: Print working directorycd
: Change directoryhistory
: Display command history
- Execution of system utilities (ls, grep, kill,..)
- Command history management
You'll be presented with a prompt ($
) where you can enter commands.
$ pwd
/home/user/projects
$ echo Hello, World!
Hello, World!
$ cd /tmp
$ history
- Uses the
readline
library for improved input handling - Implements a hash table for efficient built-in command lookup
- Utilizes system calls like
fork()
,execv()
, andchdir()
for command execution and directory navigation - Manages command history with a maximum of 1000 entries