我想将两种不同的文件名模式分成两个不同的文件夹。
两个文件名模式是:
和
答案 0 :(得分:1)
这会将第一个组移动到folder1:
mv *s[0-9][0-9]* *e[0-9][0-9]* *s[0-9]e[0-9][0-9][0-9]* *[0-9]x[0-9][0-9]* folder1
将这些文件排除在外,这会将那些看起来像有效年份的文件移到folder2:
mv *19[0-9][0-9]* *20[0-9][0-9]* folder2
在这里,我假设有效的一年"将在1900年至2099年之间。
答案 1 :(得分:0)
感谢John1024。
这是一个用于识别和分离电影的脚本。电视节目。只需确保在第一行末尾编辑/ path / to / tv-shows /目录,并在第二行末尾编辑/ path / to / movies /目录。
find "$TR_TORRENT_DIR/$TR_TORRENT_NAME" -type f -a -not -size -100M -a -not -size +2G -a -not -iname "*sample*" -a -iname "*s[0-9]*" -o -type f -a -not -size -100M -a -not -size +2G -a -not -iname "*sample*" -a -iname "*e[0-9]*" -o -type f -a -not -size -100M -a -not -size +2G -a -not -iname "*sample*" -a -iname "*s[0-9]e[0-9]*" -o -type f -a -not -size -100M -a -not -size +2G -a -not -iname "*sample*" -a -iname "*s[0-9]e[0-9][0-9][0-9]*" -o -type f -a -not -size -100M -a -not -size +2G -a -not -iname "*sample*" -a -iname "*[0-9]x[0-9][0-9]*" -exec cp {} /path/to/tv-shows/ \;
find "$TR_TORRENT_DIR/$TR_TORRENT_NAME" -type f -a -size +500M -a -not -iname "*sample*" -a -not -iname "*s[0-9]*" -a -iname "*19[0-9][0-9]*" -o -type f -a -size +500M -a -not -iname "*sample*" -a -not -iname "*e[0-9]*" -a -iname "*19[0-9][0-9]*" -o -type f -a -size +500M -a -not -iname "*sample*" -a -not -iname "*s[0-9]e[0-9]*" -a -iname "*19[0-9][0-9]*" -o -type f -a -size +500M -a -not -iname "*sample*" -a -not -iname "*s[0-9]e[0-9][0-9][0-9]*" -a -iname "*19[0-9][0-9]*" -o -type f -a -size +500M -a -not -iname "*sample*" -a -not -iname "*[0-9]x[0-9][0-9]*" -a -iname "*19[0-9][0-9]*" -o -type f -a -size +500M -a -not -iname "*sample*" -a -not -iname "*s[0-9]*" -a -iname "*20[0-9][0-9]*" -o -type f -a -size +500M -a -not -iname "*sample*" -a -not -iname "*e[0-9]*" -a -iname "*20[0-9][0-9]*" -o -type f -a -size +500M -a -not -iname "*sample*" -a -not -iname "*s[0-9]e[0-9]*" -a -iname "*20[0-9][0-9]*" -o -type f -a -size +500M -a -not -iname "*sample*" -a -not -iname "*s[0-9]e[0-9][0-9][0-9]*" -a -iname "*20[0-9][0-9]*" -o -type f -a -size +500M -a -not -iname "*sample*" -a -not -iname "*[0-9]x[0-9][0-9]*" -a -iname "*20[0-9][0-9]*" -exec cp {} /path/to/movies/ \;
然后,您可以将其添加到脚本的底部,该脚本将删除和删除已完成种子设定的种子。您需要在两个位置替换用户名和密码。
transmission-remote --auth=username:password -l | grep Finished | \
awk '{print $1}' | xargs -n 1 -I % transmission-remote --auth=username:password -t % --remove-and-delete