This project provides a custom recycle bin solution for Linux systems using shell scripts. It allows users to safely delete and restore files without losing data permanently by moving files to a recycle bin instead of deleting them outright.
- Recycle files: Use
recyclebin1.shto move files to a custom recycle bin located in~/recyclebininstead of permanently deleting them. - Restore files: Use
restoreto recover files that were moved to the recycle bin, returning them to their original location. - Confirmation and Verbose modes: Enable confirmation before recycling files or get detailed output.
- Safe Deletion: Prevents deletion of the script itself to avoid accidental removal.
- Clone the repository to your local machine.
- Copy
recyclebin1.shandrestoreto a directory in your PATH (e.g.,/usr/local/bin). - Ensure both scripts are executable:
chmod +x /usr/local/bin/recyclebin1.sh chmod +x /usr/local/bin/restore
To delete (recycle) a file:
./recyclebin1.sh file_name-i: Ask for confirmation before deleting each file.-v: Enable verbose mode to print details of the operations.-r: Recursively delete directories.
Example:
./recyclebin1.sh -i -v -r directory_nameTo restore a file:
./restore file_nameIf there are multiple copies of the file in the recycle bin, the script will allow you to choose which one to restore.
- recyclebin1.sh: Script to move files to a custom recycle bin.
- restore: Script to restore files from the recycle bin.
- The recycle bin is located at
~/recyclebin. - The
restorescript keeps track of original file paths in~/recyclebin/.restore.info. - Files are stored in the recycle bin using their inode number to avoid name conflicts.