A feature-rich shell implementation in C with custom built-in commands and full support for system commands, background processes, and command history.
-
Clone/Download the project to your local machine
-
Navigate to the project directory
-
Compile the shell:
make
-
Run the shell:
./a.out
- Maximum background processes: 100 concurrent processes
- Maximum input size: 1023 characters
- Maximum path length: 4095 characters
- Command chaining: Supports multiple commands separated by
; - Background execution: Supports
&for background processes - Signal handling: Automatic cleanup of terminated background processes
Changes the current working directory with enhanced path support.
Syntax:
hop [path1] [path2] ... [pathN]
cd [path1] [path2] ... [pathN]Special Path Shortcuts:
~- Home directory.- Current directory..- Parent directory-- Previous directory
Examples:
hop ~ # Go to home directory
hop .. # Go to parent directory
hop - # Go to previous directory
hop ~/Documents # Go to Documents folder in home
hop /usr/local/bin # Absolute path navigation
hop dir1 dir2 dir3 # Navigate through multiple directories sequentiallyFeatures:
- Supports multiple path arguments (navigates to each sequentially)
- Remembers previous directory for
-navigation - Prints the full path after each directory change
- Error handling for invalid paths
Advanced file listing command with multiple display options and color-coded output.
Syntax:
reveal [options] [path]Options:
-a: Show hidden files (files starting with.)-l: Long format (detailed information)-alor-la: Combine both options
Color Coding:
- Blue: Directories
- Green: Executable files
- White: Regular files
Examples:
reveal # List files in current directory
reveal -a # Show all files including hidden ones
reveal -l # Detailed listing with permissions, size, date
reveal -al ~/Documents # Detailed listing of all files in Documents
reveal /usr/bin # List files in /usr/bin directoryLong Format Information:
- File permissions (rwxrwxrwx)
- Number of hard links
- Owner username
- Group name
- File size in bytes
- Last modification time
- File/directory name (color-coded)
Manages command history with execution, viewing, and purging capabilities.
Syntax:
log # Display command history
log purge # Clear all command history
log execute <number> # Execute command from historyExamples:
log # Show last 15 commands
log execute 3 # Execute the 3rd most recent command
log purge # Delete entire command historyFeatures:
- Automatically stores up to 15 most recent commands
- Prevents duplicate consecutive commands
- Commands are numbered from most recent (1) to oldest (15)
- Persistent storage across shell sessions
- Automatic overflow management (removes oldest when limit exceeded)
Displays detailed information about running processes.
Syntax:
proclore [pid]Examples:
proclore # Show info about current shell process
proclore 1234 # Show info about process with PID 1234Information Displayed:
- Process ID (PID): Unique process identifier
- Process Status: Current state (R=Running, S=Sleeping, Z=Zombie, etc.)
- Process Group: Process group identifier
- Virtual Memory: Memory usage in pages
- Executable Path: Full path to the executable file
Powerful search tool with filtering and execution capabilities.
Syntax:
seek [options] <target> [search_directory]Options:
-d: Search only directories-f: Search only files-e: Execute/open found item if exactly one match
Examples:
seek main.c # Search for main.c in current directory
seek -d Documents # Search for directories named "Documents"
seek -f "*.txt" ~ # Search for txt files in home directory
seek -e config.conf # Search and open config.conf if unique match
seek -df backup /usr # Search for directories named "backup" in /usrColor Coding:
- Blue: Directories
- Green: Files
Execute Feature (-e flag):
- If exactly one match found:
- Directory: Changes to that directory
- File: Displays file contents
- Multiple matches: Just lists them (no execution)
- No matches: Shows "No match found!"
- Handles permission errors gracefully
All standard system commands are supported and can be executed normally.
Examples:
ls -la # Standard ls command
grep "pattern" file.txt # Text search with grep
ps aux # Process listing
vim file.txt # Open file in vim
gcc -o program main.c # Compile C programRun commands in the background using the & operator.
Examples:
sleep 10 & # Run sleep in background
gedit file.txt & # Open text editor in background
./long_running_task & # Execute program in backgroundBackground Process Features:
- Automatic notification when background processes complete
- Tracks process names and PIDs
- Handles up to 100 concurrent background processes
- Shows exit status and termination signals
- Automatic cleanup of zombie processes
Execute multiple commands in sequence using ; separator.
Examples:
hop ~/Documents; reveal -la; log # Chain multiple commands
cd ..; ls; pwd # Navigate, list, show pathAutomatically tracks and displays execution time for long-running foreground processes (>2 seconds).
Display Format:
<username@hostname:path command_name : time_in_seconds>The shell provides a colorful, informative prompt showing:
- Username (orange color)
- Hostname (blue color)
- Current directory (with ~ substitution for home)
- Execution time for long-running commands
Smart path resolution supporting:
- Absolute paths:
/usr/local/bin - Relative paths:
../parent/directory - Home directory:
~/Documents - Previous directory:
- - Current directory:
.
Comprehensive error handling for:
- Invalid commands and arguments
- Permission denied scenarios
- File/directory not found cases
- Process execution failures
- Signal handling for interrupted processes
Exit the shell using any of these commands:
exitquitq
# Navigate to home and list files
hop ~
reveal -la
# Search for C files and view one
seek -f "*.c"
seek -e main.c
# Check command history
log
log execute 2# Run background process and check its info
sleep 30 &
proclore 1234
# Chain commands with timing
time sleep 3; echo "Done"# Search in specific directory with filters
seek -d "build" ~/projects
seek -f config /etc
# Detailed file listing with history
reveal -al /var/log; logThis shell provides a rich command-line experience with powerful built-in utilities while maintaining full compatibility with standard system commands.