A powerful Unix-like shell implementation in C, developed as a course project for CS3.301 - Operating Systems and Networks.
This custom shell project implements a feature-rich Unix-like shell in C. It supports various custom commands, system commands, background processes, logging, I/O redirection, piping, and more. The shell provides a user-friendly interface with a custom prompt and color-coded output for enhanced usability.
- Custom Prompt: Displays username, system name, and current working directory
- Multiple Command Execution: Supports sequential and background execution
- Custom Commands: Includes
hop,reveal,log,proclore,seek,activities,ping,fg,bg,neonate - System Command Execution: Supports both foreground and background processes
- I/O Redirection and Piping: Enables complex command chaining and data manipulation
- Process Management: Provides tools for monitoring and controlling processes
- Command History: Logs and manages command history for easy recall and execution
- Networking Capabilities: Fetches man pages from the internet
- GCC Compiler
- Make utility
- Unix-like operating system (Linux, macOS)
-
Clone the repository:
git clone https://github.com/frindle18/Custom-Shell cd Custom-Shell -
Compile the shell:
make
After compilation, start the shell with:
./shell
-
hop: Change the current working directory
hop <directory>- Supports
.,..,~, and-as special arguments
- Supports
-
reveal: List files and directories with color-coded output
reveal [options] [directory]- Options:
-a(show all),-l(detailed view)
- Options:
-
log: Manage command history
log log purge log execute <index> -
proclore: Display process information
proclore [pid] -
seek: Search for files or directories
seek [options] [search_term] [target_directory]- Options:
-d(directories only),-f(files only),-e(execute/change directory)
- Options:
-
activities: List all processes spawned by the shell
activities -
ping: Send signals to processes
ping <pid> <signal_number> -
neonate: Print the PID of the most recently created process
neonate -n <interval_seconds>
Execute standard system commands in foreground or background:
command [args] # Foreground
command [args] & # Background
-
I/O Redirection:
command > output.txt # Output redirection (overwrite) command >> output.txt # Output redirection (append) command < input.txt # Input redirection -
Pipes:
command1 | command2 | command3
-
Foreground Process Control:
fg <pid> -
Background Process Control:
bg <pid>
- iMan: Fetch man pages from the internet
iMan <command_name>
- Aliases: Define custom aliases in
.myshrcconfiguration file - Multiple Command Execution: Use
;for sequential execution and&for background execution - Signal Handling: Support for
Ctrl-C,Ctrl-D, andCtrl-Z
- Paths and filenames should not contain whitespace characters
- The
seekcommand's target directory should always start with. - Commands from "log execute" are not added to the command history
- Aliases do not support multiple processes
- Functions can have commands with varying numbers of arguments and will still work correctly
Developed as part of CS3.301 - Operating Systems and Networks course project.