4
我想从以下链接下载文件:为什么卷曲在这种情况下失败?
http://www.ncbi.nlm.nih.gov/sviewer/viewer.cgi?tool=portal&sendto=on&log$=seqview&db=nuccore&dopt=gilist&sort=&query_key=1&qty=12654729&filter=all
当粘贴在网页浏览器(Chrome)地址栏上面的链接,它可以让我的文件保存为“sequence.gi。文本”。
但是当我尝试在终端,我得到以下错误:
curl -o test.txt http://www.ncbi.nlm.nih.gov/sviewer/viewer.cgi?tool=portal&sendto=on&log$=seqview&db=nuccore&dopt=gilist&sort=&query_key=1&qty=12654729&filter=all
[1] 30036
[2] 30037
[3] 30038
[4] 30039
[5] 30040
[6] 30041
[7] 30042
[8] 30043
-bash: log$=seqview: command not found
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
101 7297 0 7297 0 0 59633 0 --:--:-- --:--:-- --:--:-- 79315
[1] Done curl -L -o test.txt http://www.ncbi.nlm.nih.gov/sviewer/viewer.cgi?tool=portal
[2] Done sendto=on
[3] Exit 127 log$=seqview
[4] Done db=nuccore
[5] Done dopt=gilist
[6] Done sort=
[7]- Done query_key=1
[8]+ Done qty=12654729
怎样下载在命令行的文件?
谢谢。它的工作..部分。现在上面的命令下载了一个文件,但不是我所期望的。当我通过网络浏览器下载时,我会得到一个预期的文本文件。但是通过终端,我收到包含错误信息的文件:“您的会话已过期,请重复您的搜索”。任何想法为什么差异?谢谢。 – Alby
您正在联系的网站正在通过cookie跟踪浏览会话。除非被告知,否则curl不使用cookie。虽然我不是这方面的专家。一些可能有用的信息是[here](http://curl.haxx.se/docs/http-cookies.html)和[here](http://www.charlestonsw.com/curl-from-the-command -线/)。也许这是另一个问题的主题? =) – mshildt
非常感谢!我现在明白了为什么。你的解释深度正是我所寻找的。 – Alby