Hikio is a lightweight, Unix-like shell written in C, designed to provide essential shell functionality made only for learning purpose and to explore how shell works under the hood.
- ✅ Built-in Commands
cd,pwd,clear,exit,help
- ✅ Piping
- Chaining commands with
|
- Chaining commands with
- ✅ Redirection
- Input redirection:
< - Output redirection (overwrite):
> - Output redirection (append):
>>
- Input redirection:
- ✅ Tilde Expansion
~expands to home directory
- ✅ Environment Variable Expansion
- e.g.,
$HOME,$USER,$PATH
- e.g.,
- ✅ Command History
- Arrow keys to navigate previously entered commands
- ✅ Autocompletion
- Press
Tabto auto-complete files/commands from the current directory
- Press
| Command | Description |
|---|---|
cd |
Change current directory |
pwd |
Print current working directory |
clear |
Clear the terminal screen |
exit |
Exit the shell |
help |
Display help for built-ins |
$ cd ~/Projects
# Navigate to ~/Projects using tilde expansion
$ echo $USER
# Expands environment variable
$ ls | grep ".c"
# Pipe output from ls to grep
$ sort < unsorted.txt > sorted.txt
# Redirect input and output
$ sleep 10 &
# Run sleep in the background
$ ./hikio
# Start the custom shell- GCC
- GNU Make
readlinelibrary- Optional (for better IDE support):
bear
-
Clone the repository:
git clone https://github.com/saber-88/hikio.git cd hikio -
Run the setup script:
./setup.sh
To just build for development (without installing system-wide):
make clean
bear -- make
./hikioHikio uses:
fork(),execvp(),waitpid()for process creationreadlinefor history & input line editingdup2()for redirectionpipe()to implement|opendir()/readdir()for autocompletiongetenv()for variable/tilde expansion
- Icons and colorized output for files can be added in future enhancements.
- No external dependencies apart from GNU Readline.
Pull requests and issues are welcome. This shell is built for educational purposes and open for enhancements.
Developed by Karmveer