我是 bash 脚本的新手,想创建 bash 脚本,该脚本仅根据脚本中定义的天数将旧文件(而不是目录)从源目录移动到目标目录。
#!/bin/bash
echo "Enter Your Source Directory"
read soure
echo "Enter Your Destination Directory"
read destination
echo "Enter Days"
read days
find $soure -mtime -$days -exec mv {} $destination \;
echo "Files which were $days Days old moved from $soure to $destination"
我可以移动文件,但它也保留了我不想要的特定要求的目录结构。