#!/bin/bash # 源文件夹和目标文件夹 source_dir="/path/to/source_folder" destination_dir="/path/to/destination_folder" # 指定要移动的文件数量 files_to_move=5000 # 使用find命令查找并移动文件 find "$source_dir" -type f | head -n $files_to_move | xargs -I {} mv {} "$destination_dir" echo "Moved $files_to_move files from $source_dir to $destination_dir"
标签:知名,files,move,destination,source,移动,目录,dir From: https://www.cnblogs.com/Leonardo-li/p/17807743.html