我想从以下链接下载该文件:
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.txt”.
但是当我在终端中尝试时,我收到以下错误:
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
如何在命令行中下载文件?
&在url中告诉bash,之前的所有内容都是应该在后台运行的命令.所以每一件事之后都是如此.被解释为在后台运行的新命令,这就是为什么当您尝试运行命令时会看到一堆虚假进程启动的原因.尝试将网址放在单引号’http:// ….’中,以避免bash解释$和&字符作为特殊字符:
原文链接:/bash/383386.htmlcurl -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'