Shello is a sophisticated command-line shell program that operates on a completely virtual file system (VFS), providing a sandboxed environment separate from the host computer's file system.
- In-memory file system with unlimited directory depth
- Complete isolation from host system
- Support for files, directories, and symbolic links
- File permissions and timestamps simulation
- Memory-efficient storage
- File Operations:
cat,touch,rm,cp,mv,ln - Directory Operations:
ls,mkdir,rmdir,cd,pwd,tree - Text Processing:
echo,grep,wc,head,tail,sort - System Info:
whoami,date,uptime,df,du - Utilities:
find,history,clear,help
- Command history with navigation
- Tab completion support
- File redirection (
>,>>) - Basic pipe support (
|) - Environment variables (
export,env,unset) - Command aliases
- Background process simulation (
&) - Color-coded output
- Configuration file support (
~/.shellorc)
- C++17 compatible compiler (GCC 7+ or Clang 5+)
- CMake 3.10 or higher
# Build the project
make
# Run the shell
make run
# Clean build files
make cleanAlternatively, you can use CMake directly:
mkdir build
cd build
cmake ..
make
./shello./shello# Navigate the virtual file system
pwd # Show current directory
ls # List files
ls -la # Detailed listing with hidden files
cd /home/user # Change directory
mkdir projects # Create directory
mkdir -p deep/nested/path # Create nested directories
# File operations
touch file.txt # Create empty file
echo "Hello" > file.txt # Create file with content
echo "World" >> file.txt # Append to file
cat file.txt # Display file content
cp file.txt backup.txt # Copy file
mv backup.txt old.txt # Move/rename file
rm old.txt # Delete file
# Text processing
grep "Hello" file.txt # Search in file
wc file.txt # Word count
head -5 file.txt # First 5 lines
tail -3 file.txt # Last 3 lines
sort file.txt # Sort file content
# System information
whoami # Current user
date # Current date/time
uptime # Shell uptime
df # File system usage
tree # Directory tree view
# Advanced features
history # Command history
export VAR=value # Set environment variable
env # List environment variables
alias ll="ls -la" # Create aliasecho "content" > file.txt # Redirect output to file
echo "more" >> file.txt # Append output to filels | grep txt # Pipe ls output to grep
cat file.txt | sort # Sort file contentexport PATH=/bin:/usr/bin # Set PATH variable
echo $PATH # Use variable
cd $HOME # Navigate using variableShello starts with a basic directory structure:
/
├── home/
│ └── user/ # Home directory
├── tmp/ # Temporary files
├── var/ # Variable data
└── etc/ # Configuration files
Create a ~/.shellorc file for startup commands:
# Example .shellorc
alias ll="ls -la"
alias la="ls -a"
export EDITOR=nano
echo "Welcome to Shello!"This is a demonstration project showcasing advanced C++ programming concepts including:
- Object-oriented design
- Memory management with smart pointers
- STL containers and algorithms
- Regular expressions
- Command-line interface design
This project is provided as-is for educational purposes.