A Python-based Linux terminal simulation that allows users to execute basic file system commands within a virtual environment. Includes support for file management, directory navigation, and command aliases.
- File System Management:
- Create folders and files (
mkdir
,touch
). - List directory contents (
ls
). - Read and delete files (
read
,rm
). - Rename files or folders (
mv
). - Navigate directories (
cd
,cd ..
,pwd
). - Delete folders (
rmdir
).
- Create folders and files (
- Aliases:
- Define custom aliases for frequently used commands (
alias
). - Remove aliases (
unalias
). - Save and load aliases automatically.
- Define custom aliases for frequently used commands (
- Help Menu:
- View all available commands using the
help
command.
- View all available commands using the
- Persistence:
- Virtual file system and aliases persist across sessions.
- Python 3.6 or higher.
- Clone the repository:
git clone https://github.com/Ruben2163/Python-Terminal.git
- Run Main.py:
python3 main.py
Commands | Usage |
---|---|
mkdir <folder_name> | Create a folder. |
touch <file_name> | Create a file. |
ls | List contents of the current directory. |
read <file_name> | Display the content of a file. |
rm <file_name> | Delete a file. |
rmdir <folder_name> | Delete a folder. |
mv <old_name> <new_name> | Rename a file or folder. |
cd <folder_name> | Navigate to a directory. |
cd .. | Go to the parent directory. |
pwd | Print the current working directory. |
help | Display the help menu. |
exit | Exit the terminal. |
alias | Create a shortcut for a command. |
unalias | Remove an alias. |
Python-Terminal/
│
├── main.py # Main script for the terminal interface
├── file_system.py # Handles file system and alias logic
├── virtual_fs/ # Virtual file system root directory
└── README.md # Documentation (this file)
Contributions are welcome! If you have suggestions for improvements or new features, feel free to:
- Fork the repository.
- Create a new branch.
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.