方法一
使用cp命令cp /home/usr/dir/{file1,file2,file3,file4} /home/usr/destination/
需要注意的是这几个文件之间不要有空格
具有共同前缀cp /home/usr/dir/file{1..4} ./
复制的文件是file1, file2, file3, file4
方法二
使用python脚本 shutil库import os,sys,shutil ### copies a list of files from source. handles duplicates. def rename(file_name, dst, num=1): #splits file name to add number distinction (file_prefix, exstension) = os.path.splitext(file_name) renamed = "%s(%d)%s" % (file_prefix,num,exstension) #checks if renamed file exists. Renames file if it does exist. if os.path.exists(dst + renamed): return rename(file_name, dst, num + 1) else: return renamed def copy_files(src,dst,file_list): for files in file_list: src_file_path = src + files dst_file_path = dst + files if os.path.exists(dst_file_path): new_file_name = rename(files, dst) dst_file_path = dst + new_file_name print "Copying: " + dst_file_path try: # 复制操作主要就是这句 shutil.copyfile(src_file_path,dst_file_path) except IOError: print src_file_path + " does not exis