linux - 如何使用 curl 或 wget 将文件下载到目录中?

我知道我可以使用以下 2 个命令来下载文件:

curl -O example.com/file.zip
wget example.com/file.zip

但我希望它们进入特定目录。所以我可以做到以下几点:

curl -o mydir/file.zip example.com/file.zip
wget -O mydir/file.zip example.com/file.zip

有没有办法不必指定文件名?像这样的:

curl -dir mydir example.com/file.zip

最佳答案

以下行会将所有文件下载到您提到的目录中。

wget -P /home/test www.xyz.com

这里的文件将被下载到/home/test目录

https://stackoverflow.com/questions/19416662/

相关文章:

c++ - Linux C++ : how to profile time wasted due t

php - 如何为 php 启用 mysqlnd?

python - 编译 python 时 --enable-optimizations 做了什么?

regex - shell脚本中 "=~"运算符的含义

linux - 使用非 root 用户帐户安装 Git

c - 如何在基于 Linux 的系统上的 c 程序中使用 mqueue?

node.js - Ansible 将以什么用户身份运行我的命令?

linux - 如何删除 Mercurial 存储库

linux - 永久更改 GDB 中的反汇编风格

linux - 如果我们想在版本化的源代码中搜索,使用 git grep 比使用普通 grep 更好