From 49d6293e4f6d5fc6af99299929df8ff9447f0c2e Mon Sep 17 00:00:00 2001 From: smeb y <48400087+a3165458@users.noreply.github.com> Date: Thu, 21 Mar 2024 10:08:18 +0800 Subject: [PATCH] Create del.sh --- del.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 del.sh diff --git a/del.sh b/del.sh new file mode 100644 index 0000000..ac95c59 --- /dev/null +++ b/del.sh @@ -0,0 +1,21 @@ +use + +#!/bin/bash + +# 指定需要删除 .car 文件的目录列表 +directories=("titan_storage_1" "titan_storage_2" "titan_storage_3" "titan_storage_4" "titan_storage_5") + +# 遍历目录列表 +for directory in "${directories[@]}"; do + directory_path="${directory}/assets" + + # 检查目录是否存在 + if [ -d "$directory_path" ]; then + echo "Deleting .car files in directory: $directory_path" + + # 删除目录下所有后缀为 .car 的文件 + find "$directory_path" -type f -name "*.car" -exec rm {} \; + else + echo "Directory not found: $directory_path" + fi +done