Linux 使用笔记:文件操作
552 字
3 分钟
rm <file_name># 删除文件夹及内的文件rm -r <folder_name>mv <source_file> <destination_file>cp <source_file> <destination_file># 复制文件夹及内的文件cp -r <source_folder> <destination_folder># 创建软链接ln -s <source_file> <link_file># 创建硬链接ln <source_file> <link_file>wget 命令wget 是一个非交互式的网络下载工具,简单易用,支持 HTTP、HTTPS 和 FTP。
以下是您提供的 wget 命令选项的 Markdown 表格:
| 选项 | 说明 | 示例 |
|---|---|---|
-O <文件名> | 指定保存文件名 | wget -O myfile.zip https://example.com/file.zip |
-P <目录> | 指定下载目录 | wget -P ~/downloads https://example.com/file.zip |
-c | 断点续传 | wget -c https://example.com/bigfile.iso |
-b | 后台下载 | wget -b https://example.com/largefile.mp4 |
--limit-rate=<速度> | 限速下载 | wget --limit-rate=200k https://example.com/file.iso |
-t <次数> | 设置重试次数 | wget -t 5 https://example.com/unstable.file |
--timeout=<秒> | 设置超时时间 | wget --timeout=30 https://example.com/slow.file |
-r | 递归下载 | wget -r https://example.com/directory/ |
-l <深度> | 设置递归深度 | wget -r -l 2 https://example.com/ |
-np | 不追溯至父目录 | wget -r -np https://example.com/path/ |
scp 是一个用于复制文件或目录的命令行工具,它可以在远程计算机之间进行文件传输。
scp <local_file> <username>@<remote_host>:<remote_path>scp <username>@<remote_host>:<remote_file> <local_path>scp -r <local_directory> <username>@<remote_host>:<remote_path>scp -r <username>@<remote_host>:<remote_directory> <local_path>rsync是一个用于同步文件或目录的命令行工具,它比 scp 更加高效,并且支持增量传输,因此它可以在文件或目录大小变化时快速传输。
bypybypy 是一个Python命令行工具,它允许你无缝地与百度网盘交互,提供了一种简单且高效的方式来进行文件上传、下载、管理等操作。
安装
pip install bypy登录
执行 bypy info ,按照提示操作。
下载
# 下载文件bypy downfile <remotefile> <localpath># 下载文件夹bypy downdir <remotefolder> <localpath># 使用下载器bypy --downloader aria2 download <remotefile> <localpath>unzip 命令用于解压 zip 文件。
unzip <zip_file>