From 5dcf6408e26241c0d9ce34a169f888122735c08a Mon Sep 17 00:00:00 2001 From: ondra Date: Wed, 23 Oct 2024 11:52:16 +0200 Subject: [PATCH] v0 bash script --- delete_Trash-1000.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 delete_Trash-1000.sh diff --git a/delete_Trash-1000.sh b/delete_Trash-1000.sh new file mode 100644 index 0000000..3481f2b --- /dev/null +++ b/delete_Trash-1000.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Ask the user for the path to the folder +read -p "Enter the path to the folder: " folder_path + +# Check if the provided path is valid +if [ ! -d "$folder_path" ]; then + echo "Invalid folder path. Please provide a valid directory." + exit 1 +fi + +# Find and delete all .Trash-1000 directories within the provided path +find "$folder_path" -type d -name ".Trash-1000" -exec rm -rf {} + + +echo "All .Trash-1000 folders and their contents have been deleted."