This project demonstrates a file management system implemented using Bash scripts and socket programming. It provides a web interface for local interactions using a minimal HTML form and a TCP-based client-server system for remote communication.
- Provide basic file operations (create, read, list, and delete) via web and socket interfaces.
- Demonstrate Linux socket communication using Bash and Netcat.
- Integrate a minimal web server with CGI for backend processing.
- Install
nginxusing:bashCopy codesudo apt update sudo apt install nginx - Enable CGI for handling Bash scripts in the
/usr/lib/cgi-bin/directory.
- Create a directory for files:bashCopy code
mkdir /tmp/server_files chmod 777 /tmp/server_files - Ensure all scripts are executable:bashCopy code
chmod +x file_manager.sh tcp_server.sh tcp_client.sh
Provides a web-based interface for file management with buttons to send data via forms.
Processes commands from the web interface, supporting save, read, and clear file operations.
Implements a TCP socket server. Listens for commands (WRITE, READ, LIST, DELETE, EXIT) and processes them.
A client script that connects to the server, sends commands, and displays responses.
- Start the Web ServerbashCopy code
sudo systemctl start nginx - Place Scripts
index.htmlandfile_manager.shin/usr/lib/cgi-bin/.- Ensure permissions with
chmod +x.
- Start the TCP ServerbashCopy code
./tcp_server.sh - Run the TCP ClientbashCopy code
./tcp_client.sh
Command | Description | Example -- | -- | -- WRITE | Writes content to a file. | WRITE myfile.txt Hello, world! READ | Reads and displays file content. | READ myfile.txt LIST | Lists all files in the directory. | LIST DELETE | Deletes a specified file. | DELETE myfile.txt EXIT | Stops the server. | EXIT
This project showcases a fully functional file management system using Linux-native tools and demonstrates the integration of Bash scripting with both web and socket communication.
One potential improvement for this project is implementing user authentication and access control. Currently, the system allows unrestricted access to all file operations. Adding a user login mechanism with different permission levels would enhance security and demonstrate more advanced system administration concepts.