Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ Shello Public

A sophisticated virtual shell environment built in C++17. Experience Unix-like operations with command history, file operations, pipes, and redirection within a secure virtual filesystem sandbox. Perfect for education, testing, and safe command-line experimentation, providing a complete shell experience while maintaining full host system isolation.

Notifications You must be signed in to change notification settings

FANNYMU/Shello

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shello - Virtual Shell Environment

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.

Features

Virtual 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

Core Commands

  • 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

Advanced Features

  • 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)

Building

Prerequisites

  • C++17 compatible compiler (GCC 7+ or Clang 5+)
  • CMake 3.10 or higher

Compilation

# Build the project
make

# Run the shell
make run

# Clean build files
make clean

Alternatively, you can use CMake directly:

mkdir build
cd build
cmake ..
make
./shello

Usage

Starting Shello

./shello

Basic Commands

# 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 alias

File Redirection

echo "content" > file.txt     # Redirect output to file
echo "more" >> file.txt       # Append output to file

Pipes

ls | grep txt          # Pipe ls output to grep
cat file.txt | sort    # Sort file content

Environment Variables

export PATH=/bin:/usr/bin     # Set PATH variable
echo $PATH                    # Use variable
cd $HOME                      # Navigate using variable

Virtual File System Structure

Shello starts with a basic directory structure:

/
├── home/
│   └── user/          # Home directory
├── tmp/               # Temporary files
├── var/               # Variable data
└── etc/               # Configuration files

Configuration

Create a ~/.shellorc file for startup commands:

# Example .shellorc
alias ll="ls -la"
alias la="ls -a"
export EDITOR=nano
echo "Welcome to Shello!"

Contributing

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

License

This project is provided as-is for educational purposes.

About

A sophisticated virtual shell environment built in C++17. Experience Unix-like operations with command history, file operations, pipes, and redirection within a secure virtual filesystem sandbox. Perfect for education, testing, and safe command-line experimentation, providing a complete shell experience while maintaining full host system isolation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages