获取NetBSD一个发行版源代码的tarballs, 只需:
代码: 全选
$ ftp -i ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-4.0/source/sets/
Trying 2001:4f8:4:7:2e0:81ff:fe21:6563...
Connected to ftp.NetBSD.org.
220 ftp.NetBSD.org FTP server (NetBSD-ftpd 20070809) ready.
331 Guest login ok, type your name as password.
[...]
250 CWD command successful.
250 CWD command successful.
250 CWD command successful.
ftp> mget *.tgz
local: gnusrc.tgz remote: gnusrc.tgz
229 Entering Extended Passive Mode (|||58302|)
150 Opening BINARY mode data connection for 'gnusrc.tgz' (79233899 bytes).
[...]
ftp> quit
221-
Data traffic for this session was 232797304 bytes in 5 files.
Total traffic for this session was 232803039 bytes in 6 transfers.
221 Thank you for using the FTP service on ftp.NetBSD.org.
代码: 全选
$ ls *.tgz
gnusrc.tgz sharesrc.tgz src.tgz syssrc.tgz xsrc.tgz
代码: 全选
$ foreach file (*.tgz)
? tar -xzf $file -C /usr/src
? end