$ curl -L https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.0.1.tar.xz | tar -xjkf -
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:--
0bzip2: (stdin) is not a bzip2 file.
tar: Child died with signal 13
tar: Error is not recoverable: exiting now
0 78.4M 0 17128 0 0 5499 0 4:09:26 0:00:03 4:09:23
5500
curl: (23) Failed writing body (2152 != 2896)
richard@richard-HP-ENVY-15-Notebook-PC:~$
答案1
正如错误所述,并且 URL 表明,它不是 bzip2 文件。它是一个 xz 文件,因此 的选项tar
应该是-J
,而不是-j
:
... | tar -xJkf -