Answers:
不幸的是,鹦鹉螺没有该选项。
您可以尝试使用其他文件管理器,例如Dolphin。
(需要Universe存储库)
您还可以将命令行程序cp(1)与备份选项一起使用:
cp --backup -t DESTINATION SOURCE [SOURCE...]
这具有以下效果,可以通过以下手册的页面中所述的其他选项来控制cp(1):
--backup[=CONTROL]―对每个现有目标文件进行备份
-b―喜欢--backup但不接受争论
-S,--suffix=SUFFIX―覆盖通常的备份后缀备份后缀为
~,除非使用--suffix或设置SIMPLE_BACKUP_SUFFIX。可以通过--backup选项或VERSION_CONTROL环境变量来选择版本控制方法。这些是值:
none,off:永远不要备份(即使--backup已提供)numbered,t:进行编号备份existing,nil:编号(如果存在编号的备份),否则简单simple,never:总是进行简单的备份
cp --backup=existing --suffix=.orig -t ~/Videos ~/Music/*
这会将所有文件复制~/Music到中~/Videos。如果目标文件存在相同名称的文件,则通过在文件名后附加.orig名称作为备份来重命名该文件。如果存在与备份同名的文件,则备份将通过追加来重命名,.1并且该备份也存在.2,依此类推。只有这样,源文件才被复制到目标。
如果要递归复制子目录中的文件,请使用:
cp -R --backup=existing --suffix=.orig -t ~/Videos ~/Music
--backup=existing再次阅读说明。提示:在以下情况下会发生什么touch foo bar; cp -v --backup=numbered foo bar; cp -v --backup=existing foo bar?
#!/bin/bash
cp -vn "$1" "$2"/ || cp -vn "$1" "$2"/"${1##*/}"~"$(md5sum "$1" | cut -f1 -d' ')"
具有相同名称的文件将重命名为md5sum添加到名称的文件。如果将其保存为“ saveCopy”之类的文件名,则可以使用find它来执行它:
find . -name 'z*.jpg' -exec ./saveCopy {} /tmp/Extracted/ \;
有关更多信息,请参见链接。
以前在此论坛上有一个针对该问题的解决方案(超复印机):请参阅https://ubuntuforums.org/showthread.php?t=2251859根据该讨论,它可以集成到Nautilus中。
将此脚本复制到顶层目录,使其可执行并运行:
#!/bin/bash
## Get a list of all files
list=$(find . -mindepth 2 -type f -print)
nr=1
## Move all files that are unique
find . -mindepth 2 -type f -print0 | while IFS= read -r -d '' file; do
mv -n $file ./
done
list=$(find . -mindepth 2 -type f -print)
## Checking which files need to be renamed
while [[ $list != '' ]] ; do
##Remaming the un-moved files to unique names and move the renamed files
find . -mindepth 2 -type f -print0 | while IFS= read -r -d '' file; do
current_file=$(basename $file)
mv -n $file "./${nr}${current_file}"
done
## Incrementing counter to prefix to file name
nr=$((nr+1))
list=$(find . -mindepth 2 -type f -print)
done