【问题标题】:How to curl images to specific folder/directory如何将图像卷曲到特定文件夹/目录
【发布时间】:2019-05-30 20:41:07
【问题描述】:

我正在使用此代码:

xargs -n 1 curl -O

从文本文件中下载所有图片网址。

所有图片正在下载到主目录。

如何指定要下载到的文件夹/目录?

【问题讨论】:

    标签: curl xargs


    【解决方案1】:

    curl 没有特定选项来指定-O 的下载目录。解决这个问题的标准方法是简单地将您的命令行首先 cd 放到您选择将文件下载到的目录中。

    可能是这样的:

    #!bin/sh
    # figure out where we are
    pwd=`pwd`
    
    # go to the download directory
    cd /tmp/my-downloads
    
    # Download into the right dir, find the URL file in the original dir
    xargs -n 1 curl -O < $pwd/urls.txt
    

    【讨论】:

      猜你喜欢
      • 2018-12-02
      • 1970-01-01
      • 2020-08-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-11
      • 1970-01-01
      • 2023-01-18
      相关资源
      最近更新 更多