more verbose

This commit is contained in:
2024-10-23 11:54:37 +02:00
parent 5dcf6408e2
commit d6fe061776

View File

@@ -10,6 +10,23 @@ if [ ! -d "$folder_path" ]; then
fi fi
# Find and delete all .Trash-1000 directories within the provided path # Find and delete all .Trash-1000 directories within the provided path
find "$folder_path" -type d -name ".Trash-1000" -exec rm -rf {} + echo "Searching for .Trash-1000 folders in $folder_path..."
echo "All .Trash-1000 folders and their contents have been deleted." trash_folders=$(find "$folder_path" -type d -name ".Trash-1000")
if [ -z "$trash_folders" ]; then
echo "No .Trash-1000 folders found."
else
echo "Found the following .Trash-1000 folders:"
echo "$trash_folders"
echo
# Loop through each found folder and delete it while displaying progress
while IFS= read -r folder; do
echo "Deleting folder: $folder"
rm -rf "$folder"
echo "Deleted $folder"
done <<< "$trash_folders"
echo "All .Trash-1000 folders have been deleted."
fi