copy
limactl copy
在主机和客户机之间复制文件
概述
在主机和客户机之间复制文件
在客户机文件名前加上实例名和冒号。
Backends:
auto - Automatically selects the best available backend (rsync preferred, falls back to scp)
rsync - Uses rsync for faster transfers with resume capability (requires rsync on both host and guest)
scp - Uses scp for reliable transfers (always available)
不要与 ’limactl clone’ 混淆。
limactl copy SOURCE ... TARGET [flags]
示例
# Copy file from guest to host (auto backend)
limactl copy default:/etc/os-release .
# Copy file from host to guest with verbose output
limactl copy -v myfile.txt default:/tmp/
# Copy directory recursively using rsync backend
limactl copy --backend=rsync -r ./mydir default:/tmp/
# Copy using scp backend specifically
limactl copy --backend=scp default:/var/log/app.log ./logs/
# Copy multiple files
limactl copy file1.txt file2.txt default:/tmp/
选项
--backend string Copy backend (scp|rsync|auto) (default "auto")
-h, --help help for copy
-r, --recursive Copy directories recursively
-v, --verbose Enable verbose output
从父命令继承的选项
--debug 调试模式
--log-format string 设置日志格式 [text, json] (default "text")
--log-level string 设置日志级别 [trace, debug, info, warn, error]
--tty 启用 TUI 交互,如打开编辑器。默认在终端时为 true。自动化时设为 false。
-y, --yes --tty=false 的别名
另请参见
- limactl - Lima: Linux 虚拟机