🚀 Python Terminal Emulator Demo Link
A fully functioning command terminal emulator built in Python that mimics real system terminal behavior with cross-platform compatibility.
- 🗂️ Complete File Operations:
ls,cd,pwd,mkdir,rm,cp,mv,touch,cat - 🖥️ System Monitoring:
ps,top,df,free,whoamiwith real-time data - 🔧 Built-in Commands:
help,history,clear,exit,echo,set,env - 🌐 Cross-platform: Works on Windows, Linux, and macOS
- 🎯 Windows Aliases:
dir,copy,del,type,clsfor Windows users - 📝 Command History: Session-based command tracking
- 🔀 Output Redirection: Basic file redirection support
- ⚡ Error Handling: Comprehensive error handling for invalid commands
- 🎨 Clean CLI Interface: Simple and intuitive command-line interface
- Python 3.7+
- psutil library (auto-installed)
-
Clone this repository:
git clone https://github.com/ramgopal-m/python-terminal-emulator.git cd python-terminal-emulator -
Run the terminal:
python main.py
Run the included demo script to see all features in action:
python demo.py# File operations
ls -la # List files with details
mkdir test_folder # Create directory
cd test_folder # Change directory
touch example.txt # Create file
echo "Hello World" > example.txt # Write to file
cat example.txt # Read file content
# System monitoring
ps # List running processes
top # System resource usage
df # Disk space information
free # Memory usage
# Utilities
history # Command history
help # Available commands
clear # Clear screenpython main.pypython_terminal/
├── main.py # Entry point
├── core/
│ └── terminal.py # Main terminal engine
├── commands/
│ ├── file_ops.py # File operations
│ └── system_info.py # System monitoring
├── interfaces/
│ └── cli.py # Command-line interface
├── utils/
│ ├── state.py # Terminal state management
│ ├── command_parser.py # Command parsing logic
│ └── history.py # Command history
└── requirements.txt # Dependencies
| Command | Description | Examples |
|---|---|---|
ls / dir |
List directory contents | ls, ls -la, dir |
cd |
Change directory | cd folder, cd .., cd /home |
pwd |
Print working directory | pwd |
mkdir |
Create directory | mkdir newfolder |
rm / del |
Remove files/directories | rm file.txt, del folder |
cp / copy |
Copy files | cp source.txt dest.txt |
mv |
Move/rename files | mv old.txt new.txt |
touch |
Create empty file | touch newfile.txt |
cat / type |
Display file contents | cat file.txt, type file.txt |
| Command | Description |
|---|---|
ps |
List running processes |
top |
Display system resources |
df |
Show disk space usage |
free |
Display memory usage |
whoami |
Current user information |
| Command | Description |
|---|---|
help |
Show available commands |
history |
Display command history |
clear / cls |
Clear terminal screen |
exit / quit |
Exit terminal |
echo |
Print text to output |
set |
Set environment variables |
env |
Display environment variables |
- Live Demo: https://python-terminal-emulator.vercel.app/
- Interactive Terminal: Full-featured web terminal with system monitoring
- Standalone Executable: Run without Python installation
- Cross-platform: Windows, Linux, and macOS support
This project was developed for the SRM Hacks with CodeMate competition, showcasing:
- Innovation: Complete terminal emulator built from scratch
- Technical Excellence: Modular architecture with comprehensive error handling
- Cross-platform Compatibility: Works seamlessly across operating systems
- Real-world Utility: Practical tool for developers and system administrators
- ✅ Fully functional terminal with 20+ commands
- ✅ Real-time system monitoring capabilities
- ✅ Professional code architecture and documentation
- ✅ Comprehensive testing and demo scripts
- ✅ Web deployment interface for easy distribution
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Developed by Ramgopal M for SRM Hacks with CodeMateai
🏆 Built for SRM Hacks with CodeMate - Empowering developers with powerful terminal solutions
ps- Show running processestop- Show system resource usagedf- Show disk usagefree- Show memory usagewhoami- Show current user
help- Show available commandshistory- Show command historyclear- Clear terminal screenexit- Exit terminal