Ubuntu文件管理中移动大文件的常用方法
Nautilus是Ubuntu的默认文件管理器,操作直观,适合大多数用户:
Super+E启动)。Ctrl键可多选)。Ctrl+X)。Ctrl+V)。mv -i命令(见命令行部分)。若需要更高效的批量操作或额外功能(如分块传输、进度条),可安装第三方工具:
yy选中文件,p粘贴到目标目录)。mv命令(基础移动)mv(move)是Ubuntu中移动文件的核心命令,语法简洁:
mv /path/to/source/largefile.iso /path/to/destination/(将largefile.iso移动到目标目录)。mv /path/to/source/*.mp4 /path/to/destination/(移动源目录下所有.mp4文件到目标目录)。mv file.txt newdir/会将file.txt移动到newdir,若newdir不存在则会报错);mv会直接覆盖,可使用mv -i(交互模式)提示确认。rsync命令(增量/断点续传)rsync是强大的文件同步工具,适合大文件或需要断点续传的场景,支持增量复制(仅传输变化的部分):
rsync -av --remove-source-files /path/to/source/largefile.iso /path/to/destination/
-a:归档模式(保留文件属性,如权限、时间戳);-v:显示详细传输过程;--remove-source-files:传输完成后删除源文件(相当于移动而非复制)。若移动大文件耗时较长(如几十GB以上),可使用screen或tmux将任务放到后台,防止终端关闭导致中断:
screen:
screen(若未安装):sudo apt install screen;screen -S move_large_file;mv或rsync命令;Ctrl+A,再按D分离会话(任务在后台继续运行);screen -ls,恢复会话:screen -r move_large_file。移动前需确认目标位置有足够空间,避免操作失败:
df -h命令查看各分区剩余空间(重点关注目标分区的Avail列)。若目标设备(如U盘)不支持大文件(如FAT32格式限制单文件≤4GB),可使用split命令分割文件:
split -b 2G largefile.iso largefile_part_(将largefile.iso分割成2GB/个的小文件,命名为largefile_part_aa、largefile_part_ab等)。cat largefile_part_* > largefile_restored.iso合并。使用ionice和nice命令降低移动任务对系统的影响(如避免占用过多磁盘或CPU资源):
ionice -c 2 -n 7 nice -n 19 mv largefile.iso /path/to/destination/
ionice -c 2 -n 7:将I/O优先级设为“best-effort”(等级2),低优先级(7);nice -n 19:将CPU优先级设为最低(19)。