我们在 Linux 服务器上安装软件,有时候需要在服务器下载 GitHub 上 Release 的一些资源(软件包),这时候我们可以使用 wget 或者 curl 进行处理,这里拿 htslib 开源的配置中心 HTSlib 为例,下载他的 Release 版本。
image.png

wget

  1. wget --no-check-certificate --content-disposition https://github.com/samtools/htslib/releases/download/1.15.1/htslib-1.15.1.tar.bz2

curl

  1. curl -LjO https://github.com/samtools/htslib/releases/download/1.15.1/htslib-1.15.1.tar.bz2
  • -L, —location

Follow redirects,如果服务器报告请求的页面已移动到不同的位置(用 Location: 标头和 3XX 响应代码指示),此选项将使 curl 在新位置重做请求,即重定向。)

  • -O, —remote-name

Write output to a file named as the remote file,把输出写到该文件中,保留远程文件的文件名。

  • -j, —junk-session-cookies

Ignore session cookies read from file