This Bash script is designed to manage a main folder with subdirectories. It checks for duplicate filenames within the main folder, moves files from the subdirectories to the main folder, and deletes empty subdirectories.
- Bash (tested with Bash version 4.4)
- Linux or Unix system (the script has been tested on Unraid)
-
Download the script and save it on your system.
-
Give execution permission to the script:
chmod +x script.sh
-
Run the script and provide the path to the main folder as an argument:
./script.sh /path/to/main/folder
Make sure you have the necessary permissions to execute the script and access the main folder and its subdirectories.
-
The script will check for duplicate filenames within the main folder and display them if any are found. It will then move all files from the subdirectories to the main folder. Empty subdirectories will also be deleted.
Note: Please make sure to have a backup of your data before running the script to avoid accidental data loss.
This script is licensed under the MIT License. For more information, please see the LICENSE file.
- mirisbowring - Developer
If you have any questions or encounter an issue with the script, please create an issue on GitHub.