Yêu cầu python so với wget

Quyền được cấp để sao chép, phân phối và/hoặc sửa đổi tài liệu này theo các điều khoản của Giấy phép Tài liệu Tự do GNU, Phiên bản 1. 3 hoặc bất kỳ phiên bản nào mới hơn do Tổ chức Phần mềm Tự do xuất bản; . Một bản sao của giấy phép được bao gồm trong phần có tiêu đề “Giấy phép Tài liệu Miễn phí GNU”


1. Tổng quan

GNU Wget là một tiện ích miễn phí để tải xuống các tệp không tương tác từ Web. Nó hỗ trợ các giao thức HTTP, HTTPS và FTP, cũng như truy xuất thông qua proxy HTTP

Chương này là tổng quan một phần về các tính năng của Wget

  • Wget không tương tác, có nghĩa là nó có thể hoạt động ở chế độ nền, trong khi người dùng không đăng nhập. Điều này cho phép bạn bắt đầu truy xuất và ngắt kết nối khỏi hệ thống, để Wget hoàn thành công việc. Ngược lại, hầu hết các trình duyệt Web yêu cầu sự hiện diện liên tục của người dùng, điều này có thể gây trở ngại lớn khi truyền nhiều dữ liệu
  • Wget có thể theo các liên kết trong các trang HTML, XHTML và CSS để tạo các phiên bản cục bộ của các trang web từ xa, tái tạo hoàn toàn cấu trúc thư mục của trang gốc. Điều này đôi khi được gọi là "tải xuống đệ quy. ” Trong khi làm điều đó, Wget tôn trọng Tiêu chuẩn Loại trừ Robot (/robots. txt). Wget có thể được hướng dẫn để chuyển đổi các liên kết trong các tệp đã tải xuống để trỏ đến các tệp cục bộ để xem ngoại tuyến
  • Kết hợp ký tự đại diện tên tệp và phản chiếu đệ quy của các thư mục khả dụng khi truy xuất qua FTP. Wget có thể đọc thông tin tem thời gian được cung cấp bởi cả máy chủ HTTP và FTP và lưu trữ cục bộ. Do đó, Wget có thể xem liệu tệp từ xa có thay đổi kể từ lần truy xuất cuối cùng hay không và tự động truy xuất phiên bản mới nếu nó có. This makes Wget suitable for mirroring of FTP sites, as well as home pages
  • Wget đã được thiết kế để hoạt động mạnh mẽ trên các kết nối mạng chậm hoặc không ổn định; . Nếu máy chủ hỗ trợ lấy lại, nó sẽ hướng dẫn máy chủ tiếp tục tải xuống từ nơi nó dừng lại
  • Wget hỗ trợ máy chủ proxy, có thể giảm tải mạng, tăng tốc độ truy xuất và cung cấp quyền truy cập sau tường lửa. Wget uses the passive FTP downloading by default, active FTP being an option
  • Wget hỗ trợ IP phiên bản 6, thế hệ IP tiếp theo. IPv6 được tự động phát hiện tại thời điểm biên dịch và có thể bị vô hiệu hóa tại thời điểm xây dựng hoặc chạy. Các tệp nhị phân được xây dựng với hỗ trợ IPv6 hoạt động tốt trong cả môi trường chỉ dành cho IPv4 và gia đình kép
  • Built-in features offer mechanisms to tune which links you wish to follow (see )
  • The progress of individual downloads is traced using a progress gauge. Interactive downloads are tracked using a “thermometer”-style gauge, whereas non-interactive ones are traced with dots, each dot representing a fixed amount of data received (1KB by default). Either gauge can be customized to your preferences
  • Most of the features are fully configurable, either through command line options, or via the initialization file . wgetrc (see ). Wget allows you to define global startup files (/usr/local/etc/wgetrc by default) for site settings. You can also specify the location of a startup file with the –config option. To disable the reading of config files, use –no-config. If both –config and –no-config are given, –no-config is ignored
  • Finally, GNU Wget is free software. This means that everyone may use it, redistribute it and/or modify it under the terms of the GNU General Public License, as published by the Free Software Foundation (see the file COPYING that came with GNU Wget, for details)

2 Invoking

By default, Wget is very simple to invoke. The basic syntax is

Wget will simply download all the URLs specified on the command line. URL is a Uniform Resource Locator, as defined below

However, you may wish to change some of the default parameters of Wget. You can do it two ways. permanently, adding the appropriate command to . wgetrc (see ), or specifying it on the command line


2. 1 URL Format

URL is an acronym for Uniform Resource Locator. A uniform resource locator is a compact string representation for a resource available via the Internet. Wget nhận ra cú pháp URL theo RFC1738. Đây là hình thức được sử dụng rộng rãi nhất (dấu ngoặc vuông biểu thị các phần tùy chọn)

http://host[:port]/directory/file
ftp://host[:port]/directory/file

Bạn cũng có thể mã hóa tên người dùng và mật khẩu của mình trong một URL

ftp://user:password@host/path
http://user:password@host/path

Có thể bỏ qua người dùng hoặc mật khẩu hoặc cả hai. Nếu bạn bỏ qua tên người dùng hoặc mật khẩu HTTP, sẽ không có xác thực nào được gửi. Nếu bạn bỏ qua tên người dùng FTP, 'ẩn danh' sẽ được sử dụng. Nếu bạn bỏ qua mật khẩu FTP, địa chỉ email của bạn sẽ được cung cấp làm mật khẩu mặc định

Lưu ý quan trọng. nếu bạn chỉ định một URL chứa mật khẩu trên dòng lệnh, tên người dùng và mật khẩu sẽ hiển thị rõ ràng đối với tất cả người dùng trên hệ thống, bằng cách

wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
2. Trên các hệ thống nhiều người dùng, đây là một rủi ro bảo mật lớn. Để giải quyết vấn đề này, hãy sử dụng
wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
3 và cung cấp URL cho đầu vào tiêu chuẩn của Wget, mỗi URL nằm trên một dòng riêng biệt, được kết thúc bởi C-d

Bạn có thể mã hóa các ký tự không an toàn trong URL dưới dạng '%xy',

wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
4 là biểu diễn thập lục phân của giá trị ASCII của ký tự. Một số ký tự không an toàn phổ biến bao gồm '%' (được trích dẫn là '%25'), '. ’ (được trích dẫn là ‘%3A’) và ‘@’ (được trích dẫn là ‘%40’). Tham khảo RFC1738 để biết danh sách đầy đủ các ký tự không an toàn

Wget cũng hỗ trợ tính năng

wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
5 cho URL FTP. Theo mặc định, các tài liệu FTP được truy xuất ở chế độ nhị phân (nhập 'i'), có nghĩa là chúng được tải xuống không thay đổi. Một chế độ hữu ích khác là chế độ 'a' (ASCII), chuyển đổi các dấu phân cách dòng giữa các hệ điều hành khác nhau và do đó rất hữu ích cho các tệp văn bản. Đây là một ví dụ

ftp://host/directory/file;type=a

Hai biến thể thay thế của đặc tả URL cũng được hỗ trợ, vì lý do lịch sử (cuồng loạn?) và việc sử dụng rộng rãi của chúng

Cú pháp chỉ dành cho FTP (được hỗ trợ bởi

wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
6)

Cú pháp chỉ dành cho HTTP (được giới thiệu bởi

wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
7)

These two alternative forms are deprecated, and may cease being supported in the future

If you do not understand the difference between these notations, or do not know which one to use, just use the plain ordinary format you use with your favorite browser, like

wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
8 or
wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
7


2. 2 Tùy chọn Cú pháp

Vì Wget sử dụng GNU getopt để xử lý các đối số dòng lệnh, mọi tùy chọn đều có dạng dài cùng với dạng ngắn. Các tùy chọn dài sẽ thuận tiện hơn để nhớ, nhưng mất thời gian để gõ. You may freely mix different option styles, or specify options after the command-line arguments. Vì vậy bạn có thể viết

wget -r --tries=10 http://fly.srk.fer.hr/ -o log

Khoảng cách giữa tùy chọn chấp nhận một đối số và đối số có thể được bỏ qua. Instead of ‘-o log’ you can write ‘-olog’

Bạn có thể đặt một số tùy chọn không yêu cầu đối số cùng nhau, chẳng hạn như

Điều này hoàn toàn tương đương với

Vì các tùy chọn có thể được chỉ định sau các đối số, bạn có thể chấm dứt chúng bằng '--'. Vì vậy, phần sau sẽ cố tải xuống URL '-x', báo cáo không đăng nhập được

Tất cả các tùy chọn chấp nhận danh sách được phân tách bằng dấu phẩy đều tôn trọng quy ước chỉ định danh sách trống sẽ xóa giá trị của nó. Điều này có thể hữu ích để xóa. cài đặt wgetrc. Ví dụ, nếu bạn. wgetrc đặt

No options        -> ftp.xemacs.org/pub/xemacs/
-nH               -> pub/xemacs/
-nH --cut-dirs=1  -> xemacs/
-nH --cut-dirs=2  -> .

--cut-dirs=1      -> ftp.xemacs.org/xemacs/
...
0 thành /cgi-bin, ví dụ sau trước tiên sẽ đặt lại nó, sau đó đặt thành loại trừ /~nobody và /~somebody. Bạn cũng có thể xóa danh sách trong. wgetrc (see )

wget -X '' -X /~nobody,/~somebody

Hầu hết các tùy chọn không chấp nhận đối số là các tùy chọn boolean, được đặt tên như vậy vì trạng thái của chúng có thể được nắm bắt bằng biến có-hoặc-không (“boolean”). Ví dụ: ‘--follow-ftp’ yêu cầu Wget theo dõi các liên kết FTP từ các tệp HTML và mặt khác, ‘--no-glob’ yêu cầu Wget không thực hiện toàn cầu hóa tệp trên các URL FTP. Một tùy chọn boolean là khẳng định hoặc phủ định (bắt đầu bằng '--no'). Tất cả các tùy chọn như vậy chia sẻ một số thuộc tính

Trừ khi có quy định khác, người ta cho rằng hành vi mặc định ngược lại với những gì tùy chọn thực hiện. For example, the documented existence of ‘--follow-ftp’ assumes that the default is to not follow FTP links from HTML pages

Các tùy chọn khẳng định có thể bị phủ nhận bằng cách thêm '--no-' vào tên tùy chọn; . Điều này có vẻ thừa—nếu mặc định cho một tùy chọn khẳng định là không làm điều gì đó, thì tại sao lại cung cấp một cách để tắt nó đi một cách rõ ràng? . Chẳng hạn, sử dụng

No options        -> ftp.xemacs.org/pub/xemacs/
-nH               -> pub/xemacs/
-nH --cut-dirs=1  -> xemacs/
-nH --cut-dirs=2  -> .

--cut-dirs=1      -> ftp.xemacs.org/xemacs/
...
1 trong. wgetrc makes Wget follow FTP links by default, and using ‘--no-follow-ftp’ is the only way to restore the factory default from the command line


2. 3 tùy chọn khởi động cơ bản

'-V''--phiên bản'

Display the version of Wget

‘-h’‘--giúp đỡ’

In thông báo trợ giúp mô tả tất cả các tùy chọn dòng lệnh của Wget

'-b''--nền'

Chuyển đến nền ngay sau khi khởi động. If no output file is specified via the ‘-o’, output is redirected to wget-log

‘-e command’‘--execute command’

Thực hiện lệnh như thể nó là một phần của. wgetrc (xem ). Một lệnh được gọi như vậy sẽ được thực thi sau các lệnh trong. wgetrc, do đó được ưu tiên hơn chúng. Nếu bạn cần chỉ định nhiều hơn một lệnh wgetrc, hãy sử dụng nhiều phiên bản của '-e'


2. 4 Tùy chọn tệp ghi nhật ký và đầu vào

‘-o logfile’‘--output-file=logfile’

Ghi tất cả các tin nhắn vào logfile. Các thông báo thường được báo cáo là lỗi tiêu chuẩn

‘-a logfile’‘--append-output=logfile’

Nối vào logfile. Điều này giống như '-o', chỉ có điều nó nối thêm vào tệp nhật ký thay vì ghi đè lên tệp nhật ký cũ. Nếu tệp nhật ký không tồn tại, một tệp mới sẽ được tạo

'-d''--gỡ lỗi'

Bật đầu ra gỡ lỗi, nghĩa là nhiều thông tin quan trọng đối với các nhà phát triển của Wget nếu nó không hoạt động bình thường. Quản trị viên hệ thống của bạn có thể đã chọn biên dịch Wget mà không hỗ trợ gỡ lỗi, trong trường hợp đó, '-d' sẽ không hoạt động. Xin lưu ý rằng việc biên dịch với hỗ trợ gỡ lỗi luôn an toàn—Wget được biên dịch với hỗ trợ gỡ lỗi sẽ không in bất kỳ thông tin gỡ lỗi nào trừ khi được yêu cầu với '-d'. See , for more information on how to use ‘-d’ for sending bug reports

'-q''--im lặng'

Tắt đầu ra của Wget

‘-v’‘--verbose’

Bật đầu ra dài dòng, với tất cả dữ liệu có sẵn. Đầu ra mặc định là dài dòng

‘-nv’‘--no-dài dòng’

Tắt dài dòng mà không hoàn toàn im lặng (sử dụng '-q' cho điều đó), có nghĩa là các thông báo lỗi và thông tin cơ bản vẫn được in

'--report-speed=type'

Băng thông đầu ra dưới dạng loại. Giá trị duy nhất được chấp nhận là 'bit'

'-i tệp''--input-file=file'

Đọc URL từ tệp cục bộ hoặc tệp bên ngoài. Nếu '-' được chỉ định dưới dạng tệp, các URL được đọc từ đầu vào tiêu chuẩn. (Sử dụng '. /-' để đọc từ một tệp có tên theo nghĩa đen là '-'. )

Nếu chức năng này được sử dụng, không cần có URL trên dòng lệnh. Nếu có cả URL trên dòng lệnh và trong tệp đầu vào, những URL trên dòng lệnh sẽ là những cái đầu tiên được truy xuất. Nếu '--force-html' không được chỉ định, thì tệp phải bao gồm một loạt các URL, mỗi URL một dòng

Tuy nhiên, nếu bạn chỉ định '--force-html', tài liệu sẽ được coi là 'html'. Trong trường hợp đó, bạn có thể gặp sự cố với các liên kết tương đối, bạn có thể giải quyết vấn đề này bằng cách thêm

No options        -> ftp.xemacs.org/pub/xemacs/
-nH               -> pub/xemacs/
-nH --cut-dirs=1  -> xemacs/
-nH --cut-dirs=2  -> .

--cut-dirs=1      -> ftp.xemacs.org/xemacs/
...
2 vào tài liệu hoặc bằng cách chỉ định '--base=url' trên dòng lệnh

Nếu tệp là tệp bên ngoài, tài liệu sẽ tự động được coi là 'html' nếu Loại nội dung khớp với 'text/html'. Furthermore, the file’s location will be implicitly used as base href if none was specified

'--input-metalink=tệp'

Tải xuống các tệp có trong tệp Metalink cục bộ. Metalink version 3 and 4 are supported

'--keep-badhash'

Giữ các tệp của Metalink đã tải xuống với hàm băm xấu. Nó nối thêm. badhash vào tên các tệp của Metalink có tổng kiểm tra không khớp, ngoại trừ việc không ghi đè lên các tệp hiện có

‘--metalink-over-http’

Đưa ra yêu cầu HTTP HEAD thay vì GET và trích xuất siêu dữ liệu Metalink từ các tiêu đề phản hồi. Sau đó, nó chuyển sang tải xuống Metalink. Nếu không tìm thấy siêu dữ liệu Metalink hợp lệ, nó sẽ quay lại tải xuống HTTP thông thường. Bật 'Loại nội dung. tải xuống/xử lý tệp application/metalink4+xml’

'--metalink-index=number''--preferred-location'

Đặt vị trí ưa thích cho tài nguyên Metalink. Điều này có hiệu lực nếu có nhiều tài nguyên có cùng mức độ ưu tiên

‘--xattr’

Cho phép sử dụng các thuộc tính mở rộng của hệ thống tệp để lưu URL gốc và giá trị tiêu đề HTTP của Người giới thiệu nếu được sử dụng

Xin lưu ý rằng URL có thể chứa thông tin cá nhân như mã thông báo truy cập hoặc thông tin đăng nhập

‘-F’‘--force-html’‘-B URL’‘--base=URL’

Giải quyết các liên kết tương đối bằng cách sử dụng URL làm điểm tham chiếu, khi đọc các liên kết từ tệp HTML được chỉ định qua tùy chọn '-i'/'--input-file' (cùng với '--force-html' hoặc khi tệp đầu vào . Điều này tương đương với sự hiện diện của thẻ

No options        -> ftp.xemacs.org/pub/xemacs/
-nH               -> pub/xemacs/
-nH --cut-dirs=1  -> xemacs/
-nH --cut-dirs=2  -> .

--cut-dirs=1      -> ftp.xemacs.org/xemacs/
...
3 trong tệp đầu vào HTML, với URL là giá trị cho thuộc tính
No options        -> ftp.xemacs.org/pub/xemacs/
-nH               -> pub/xemacs/
-nH --cut-dirs=1  -> xemacs/
-nH --cut-dirs=2  -> .

--cut-dirs=1      -> ftp.xemacs.org/xemacs/
...
4

Chẳng hạn, nếu bạn chỉ định 'http. // foo/bar/a. html' cho URL và Wget đọc '. /baz/b. html' từ tệp đầu vào, nó sẽ được phân giải thành 'http. //foo/baz/b. html'

‘--config=TỆP’

Chỉ định vị trí của tệp khởi động mà bạn muốn sử dụng thay vì (các) tệp mặc định. Use –no-config to disable reading of config files. Nếu cả hai –config và –no-config đều được cung cấp, thì –no-config sẽ bị bỏ qua

‘--rejected-log=logfile’

Ghi nhật ký tất cả các lần từ chối URL vào tệp nhật ký dưới dạng các giá trị được phân tách bằng dấu phẩy. Các giá trị bao gồm lý do từ chối, URL và URL gốc mà nó được tìm thấy trong


2. 5 Tùy chọn tải xuống

'--bind-address=ADDRESS'

Khi tạo kết nối TCP/IP của máy khách, hãy liên kết với ADDRESS trên máy cục bộ. ADDRESS có thể được chỉ định làm tên máy chủ hoặc địa chỉ IP. Tùy chọn này có thể hữu ích nếu máy của bạn bị ràng buộc với nhiều IP

'--bind-dns-address=ĐỊA CHỈ'

[libcares only] Địa chỉ này ghi đè tuyến đường cho các yêu cầu DNS. Nếu bạn cần phá vỡ các cài đặt tiêu chuẩn từ /etc/resolv. conf, tùy chọn này cùng với ‘--dns-servers’ là bạn của bạn. ADDRESS phải được chỉ định là địa chỉ IPv4 hoặc IPv6. Wget cần được xây dựng với libcares để có tùy chọn này

‘--dns-servers=ADDRESSES’

[chỉ libcares] (Các) địa chỉ đã cho sẽ ghi đè địa chỉ máy chủ định danh tiêu chuẩn, e. g. as configured in /etc/resolv. conf. ĐỊA CHỈ có thể được chỉ định là địa chỉ IPv4 hoặc IPv6, được phân tách bằng dấu phẩy. Wget needs to be built with libcares for this option to be available

'-t số''--tries=số'

Set number of tries to number. Chỉ định 0 hoặc 'inf' để thử lại vô hạn. Mặc định là thử lại 20 lần, ngoại trừ các lỗi nghiêm trọng như “kết nối bị từ chối” hoặc “không tìm thấy” (404), không được thử lại

‘-O file’‘--output-document=file’‘-nc’‘--no-clobber’

Nếu một tệp được tải xuống nhiều lần trong cùng một thư mục, hành vi của Wget sẽ phụ thuộc vào một số tùy chọn, bao gồm '-nc'. Trong một số trường hợp nhất định, tệp cục bộ sẽ bị ghi đè hoặc ghi đè khi tải xuống nhiều lần. Các trường hợp khác sẽ được giữ nguyên

Khi chạy Wget mà không có '-N', '-nc', '-r' hoặc '-p', việc tải xuống cùng một tệp trong cùng một thư mục sẽ dẫn đến bản sao gốc của tệp được giữ nguyên và bản sao thứ hai được đặt tên là ' . 1’. Nếu tệp đó được tải xuống một lần nữa, bản sao thứ ba sẽ được đặt tên là 'tệp. 2', v.v. (Đây cũng là hành vi với '-nd', ngay cả khi '-r' hoặc '-p' có hiệu lực. ) Khi '-nc' được chỉ định, hành vi này bị chặn và Wget sẽ từ chối tải xuống các bản sao mới hơn của 'tệp'. Do đó, “

No options        -> ftp.xemacs.org/pub/xemacs/
-nH               -> pub/xemacs/
-nH --cut-dirs=1  -> xemacs/
-nH --cut-dirs=2  -> .

--cut-dirs=1      -> ftp.xemacs.org/xemacs/
...
5” thực sự là một cách gọi sai trong chế độ này—không phải việc ghi đè đã bị ngăn chặn (vì các hậu tố số đã ngăn cản việc ghi đè), mà là việc lưu nhiều phiên bản đã bị ngăn chặn

Khi chạy Wget với '-r' hoặc '-p', nhưng không có '-N', '-nd' hoặc '-nc', việc tải xuống lại một tệp sẽ khiến bản sao mới ghi đè lên bản cũ. Việc thêm '-nc' sẽ ngăn hành vi này, thay vào đó khiến phiên bản gốc được giữ nguyên và mọi bản sao mới hơn trên máy chủ sẽ bị bỏ qua

When running Wget with ‘-N’, with or without ‘-r’ or ‘-p’, the decision as to whether or not to download a newer copy of a file depends on the local and remote timestamp and size of the file (see ). '-nc' có thể không được chỉ định cùng lúc với '-N'

Sự kết hợp với ‘-O’/‘--output-document’ chỉ được chấp nhận nếu tệp đầu ra đã cho không tồn tại

Lưu ý rằng khi '-nc' được chỉ định, các tệp có hậu tố '. html' hoặc '. htm’ sẽ được tải từ đĩa cục bộ và được phân tích cú pháp như thể chúng được lấy từ Web

‘--backups=backups’‘--no-netrc’

Đừng cố lấy thông tin xác thực từ. netrc file. theo mặc định. tệp netrc được tìm kiếm thông tin đăng nhập trong trường hợp không có thông tin nào được chuyển qua dòng lệnh và yêu cầu xác thực

‘-c’‘--tiếp tục’

Tiếp tục nhận tệp đã tải xuống một phần. Điều này hữu ích khi bạn muốn kết thúc quá trình tải xuống được bắt đầu bởi phiên bản trước của Wget hoặc bởi một chương trình khác. Ví dụ

wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z

Nếu có một tệp có tên ls-lR. Z trong thư mục hiện tại, Wget sẽ cho rằng đó là phần đầu tiên của tệp từ xa và sẽ yêu cầu máy chủ tiếp tục truy xuất từ ​​một phần bù bằng độ dài của tệp cục bộ

Note that you don’t need to specify this option if you just want the current invocation of Wget to retry downloading a file should the connection be lost midway through. Đây là hành vi mặc định. '-c' chỉ ảnh hưởng đến việc tiếp tục tải xuống đã bắt đầu trước khi gọi Wget này và các tệp cục bộ của chúng vẫn đang nằm xung quanh

Nếu không có '-c', ví dụ trước sẽ chỉ tải tệp từ xa xuống ls-lR. Z. 1, để lại ls-lR bị cắt ngắn. Tập tin Z một mình

Nếu bạn sử dụng '-c' trên tệp không trống và máy chủ không hỗ trợ tiếp tục tải xuống, Wget sẽ khởi động lại quá trình tải xuống từ đầu và ghi đè hoàn toàn tệp hiện có

Bắt đầu với Wget 1. 7, if you use ‘-c’ on a file which is of equal size as the one on the server, Wget will refuse to download the file and print an explanatory message. The same happens when the file is smaller on the server than locally (presumably because it was changed on the server since your last download attempt)—because “continuing” is not meaningful, no download occurs

Mặt khác, trong khi sử dụng '-c', bất kỳ tệp nào trên máy chủ lớn hơn cục bộ sẽ được coi là tải xuống không đầy đủ và chỉ

No options        -> ftp.xemacs.org/pub/xemacs/
-nH               -> pub/xemacs/
-nH --cut-dirs=1  -> xemacs/
-nH --cut-dirs=2  -> .

--cut-dirs=1      -> ftp.xemacs.org/xemacs/
...
6 byte sẽ được tải xuống và gắn vào cuối tệp cục bộ. Hành vi này có thể được mong muốn trong một số trường hợp nhất định—ví dụ: bạn có thể sử dụng 'wget -c' để chỉ tải xuống phần mới được thêm vào một tập hợp dữ liệu hoặc tệp nhật ký

Tuy nhiên, nếu tệp lớn hơn trên máy chủ vì nó đã bị thay đổi, thay vì chỉ được thêm vào, bạn sẽ nhận được một tệp bị cắt xén. Wget không có cách nào xác minh rằng tệp cục bộ thực sự là tiền tố hợp lệ của tệp từ xa. Bạn cần đặc biệt cẩn thận với điều này khi sử dụng ‘-c’ kết hợp với ‘-r’, vì mọi tệp sẽ được coi là ứng cử viên "tải xuống chưa hoàn tất"

Một trường hợp khác mà bạn sẽ nhận được một tệp bị cắt xén nếu bạn cố gắng sử dụng '-c' là nếu bạn có một proxy HTTP khập khiễng chèn chuỗi "chuyển bị gián đoạn" vào tệp cục bộ. Trong tương lai, tùy chọn “rollback” có thể được thêm vào để giải quyết trường hợp này

Lưu ý rằng '-c' chỉ hoạt động với máy chủ FTP và máy chủ HTTP hỗ trợ tiêu đề

No options        -> ftp.xemacs.org/pub/xemacs/
-nH               -> pub/xemacs/
-nH --cut-dirs=1  -> xemacs/
-nH --cut-dirs=2  -> .

--cut-dirs=1      -> ftp.xemacs.org/xemacs/
...
7

‘--start-pos=OFFSET’‘--progress=type’

Chọn loại chỉ báo tiến độ bạn muốn sử dụng. Dấu hiệu pháp lý là “chấm” và “thanh”

Chỉ báo “thanh” được sử dụng theo mặc định. Nó vẽ một đồ họa thanh tiến trình ASCII (a. k. màn hình “nhiệt kế”) cho biết trạng thái truy xuất. Nếu đầu ra không phải là TTY, thanh "chấm" sẽ được sử dụng theo mặc định

Sử dụng '--progress=dot' để chuyển sang màn hình "chấm". Nó theo dõi quá trình truy xuất bằng cách in các dấu chấm trên màn hình, mỗi dấu chấm biểu thị một lượng dữ liệu đã tải xuống cố định

Loại tiến trình cũng có thể nhận một hoặc nhiều tham số. Các tham số khác nhau tùy thuộc vào loại được chọn. Các tham số cho loại được truyền bằng cách thêm chúng vào loại được phân cách bằng dấu hai chấm (. ) như thế này. '--progress = loại. tham số1. tham số2'

When using the dotted retrieval, you may set the style by specifying the type as ‘dot. Phong cách'. Các phong cách khác nhau gán ý nghĩa khác nhau cho một dấu chấm. Với kiểu

No options        -> ftp.xemacs.org/pub/xemacs/
-nH               -> pub/xemacs/
-nH --cut-dirs=1  -> xemacs/
-nH --cut-dirs=2  -> .

--cut-dirs=1      -> ftp.xemacs.org/xemacs/
...
8, mỗi dấu chấm đại diện cho 1K, có 10 dấu chấm trong một cụm và 50 dấu chấm trong một dòng. Kiểu
No options        -> ftp.xemacs.org/pub/xemacs/
-nH               -> pub/xemacs/
-nH --cut-dirs=1  -> xemacs/
-nH --cut-dirs=2  -> .

--cut-dirs=1      -> ftp.xemacs.org/xemacs/
...
9 có định hướng giống “máy tính” hơn—8 nghìn chấm, cụm 16 chấm và 48 chấm trên mỗi dòng (tạo nên 384 nghìn dòng). Kiểu
wget --no-cookies --header "Cookie: name=value"
0 phù hợp để tải xuống các tệp lớn—mỗi dấu chấm đại diện cho 64K được truy xuất, có 8 dấu chấm trong một cụm và 48 dấu chấm trên mỗi dòng (vì vậy mỗi dòng chứa 3M). Nếu
wget --no-cookies --header "Cookie: name=value"
0 không đủ thì bạn có thể sử dụng kiểu
wget --no-cookies --header "Cookie: name=value"
2—mỗi dấu chấm đại diện cho 1M được truy xuất, có tám dấu chấm trong một cụm và 32 dấu chấm trên mỗi dòng (vì vậy mỗi dòng chứa 32 triệu)

Với ‘--progress=bar’, hiện tại có hai tham số khả thi là force và noscroll

Khi đầu ra không phải là TTY, thanh tiến trình luôn quay trở lại "dấu chấm", ngay cả khi '--progress=bar' được chuyển đến Wget trong khi gọi. Hành vi này có thể bị ghi đè và đầu ra “bar” bị ép buộc bằng cách sử dụng tham số “force” là ‘--progress=bar. lực lượng'

Theo mặc định, thanh tiến trình kiểu 'thanh' cuộn tên của tệp từ trái sang phải đối với tệp đang được tải xuống nếu tên tệp vượt quá độ dài tối đa được phân bổ cho màn hình của nó. Trong một số trường hợp nhất định, chẳng hạn như với ‘--progress=bar. force', người ta có thể không muốn tên tệp cuộn trong thanh tiến trình. Bằng cách chuyển tham số “noscroll”, Wget có thể buộc phải hiển thị càng nhiều tên tệp càng tốt mà không cần cuộn qua nó

Lưu ý rằng bạn có thể đặt kiểu mặc định bằng cách sử dụng lệnh

wget --no-cookies --header "Cookie: name=value"
3 trong. wgetrc. Cài đặt đó có thể bị ghi đè từ dòng lệnh. Ví dụ: để buộc đầu ra của thanh mà không cần cuộn, hãy sử dụng ‘--progress=bar. lực lượng. không có cuộn giấy'

'--show-tiến độ'

Buộc wget hiển thị thanh tiến trình ở bất kỳ mức độ chi tiết nào

Theo mặc định, wget chỉ hiển thị thanh tiến trình ở chế độ dài dòng. Tuy nhiên, người ta có thể muốn quên hiển thị thanh tiến trình trên màn hình kết hợp với bất kỳ chế độ chi tiết nào khác như '--no-verbose' hoặc '--quiet'. Đây thường là một thuộc tính mong muốn khi gọi wget để tải xuống một số tệp nhỏ/lớn. Trong trường hợp như vậy, wget có thể được gọi đơn giản với tham số này để có được đầu ra sạch hơn nhiều trên màn hình

Tùy chọn này cũng sẽ buộc thanh tiến trình được in thành thiết bị lỗi chuẩn khi được sử dụng cùng với tùy chọn '--output-file'

'-N''--dấu thời gian'

Bật đánh dấu thời gian. Xem, để biết chi tiết

'--no-if-modified-kể từ'

Không gửi tiêu đề If-Modified-Since ở chế độ '-N'. Gửi yêu cầu HEAD sơ bộ thay thế. Điều này chỉ có tác dụng trong chế độ '-N'

'--no-use-server-timestamps'

Không đặt dấu thời gian của tệp cục bộ bằng dấu thời gian trên máy chủ

Theo mặc định, khi một tệp được tải xuống, dấu thời gian của nó được đặt để khớp với dấu thời gian từ tệp từ xa. Điều này cho phép sử dụng '--timestamping' trong các lần gọi wget tiếp theo. Tuy nhiên, đôi khi sẽ hữu ích khi căn cứ vào dấu thời gian của tệp cục bộ khi nó thực sự được tải xuống;

'-S''--phản hồi máy chủ'

In các tiêu đề được gửi bởi máy chủ HTTP và phản hồi được gửi bởi máy chủ FTP

‘--spider’‘-T seconds’‘--timeout=seconds’‘--dns-timeout=seconds’‘--connect-timeout=seconds’‘--read-timeout=seconds’

Đặt thời gian chờ đọc (và ghi) thành giây giây. “Thời gian” của thời gian chờ này đề cập đến thời gian nhàn rỗi. nếu tại bất kỳ thời điểm nào trong quá trình tải xuống, không có dữ liệu nào được nhận trong hơn số giây đã chỉ định, thì quá trình đọc không thành công và quá trình tải xuống được bắt đầu lại. Tùy chọn này không ảnh hưởng trực tiếp đến thời lượng của toàn bộ quá trình tải xuống

Tất nhiên, máy chủ từ xa có thể chọn ngắt kết nối sớm hơn tùy chọn này yêu cầu. Thời gian chờ đọc mặc định là 900 giây

'--limit-rate=số tiền'

Giới hạn tốc độ tải xuống theo số byte mỗi giây. Số tiền có thể được biểu thị bằng byte, kilobyte với hậu tố 'k' hoặc megabyte với hậu tố 'm'. Ví dụ: ‘--limit-rate=20k’ sẽ giới hạn tốc độ truy xuất ở mức 20KB/s. This is useful when, for whatever reason, you don’t want Wget to consume the entire available bandwidth

Tùy chọn này cho phép sử dụng các số thập phân, thường kết hợp với các hậu tố lũy thừa; . 5k’ là giá trị hợp pháp

Lưu ý rằng Wget thực hiện giới hạn bằng cách ngủ trong khoảng thời gian thích hợp sau khi đọc mạng mất ít thời gian hơn so với tốc độ được chỉ định. Cuối cùng, chiến lược này khiến quá trình truyền TCP chậm lại với tốc độ xấp xỉ đã chỉ định. Tuy nhiên, có thể mất một thời gian để đạt được sự cân bằng này, vì vậy đừng ngạc nhiên nếu việc giới hạn tốc độ không hoạt động tốt với các tệp rất nhỏ

‘-w giây’‘--wait=giây’

Wait the specified number of seconds between the retrievals. Nên sử dụng tùy chọn này vì nó giảm tải cho máy chủ bằng cách làm cho các yêu cầu ít thường xuyên hơn. Thay vì tính bằng giây, thời gian có thể được chỉ định bằng phút bằng cách sử dụng hậu tố

wget --no-cookies --header "Cookie: name=value"
4, tính bằng giờ bằng hậu tố
wget --no-cookies --header "Cookie: name=value"
5 hoặc tính bằng ngày bằng hậu tố
wget --no-cookies --header "Cookie: name=value"
6

Việc chỉ định một giá trị lớn cho tùy chọn này sẽ hữu ích nếu mạng hoặc máy chủ đích không hoạt động, để Wget có thể đợi đủ lâu để mong đợi một cách hợp lý rằng lỗi mạng sẽ được khắc phục trước khi thử lại. Khoảng thời gian chờ được chỉ định bởi chức năng này bị ảnh hưởng bởi

wget --no-cookies --header "Cookie: name=value"
7, xem

'--waitretry=giây'

Nếu bạn không muốn Wget đợi giữa mỗi lần truy xuất mà chỉ giữa các lần tải xuống không thành công, bạn có thể sử dụng tùy chọn này. Wget sẽ sử dụng backoff tuyến tính, đợi 1 giây sau lỗi đầu tiên trên một tệp nhất định, sau đó đợi 2 giây sau lỗi thứ hai trên tệp đó, tối đa số giây bạn chỉ định

Theo mặc định, Wget sẽ nhận giá trị là 10 giây

'--chờ-ngẫu nhiên'

Một số trang web có thể thực hiện phân tích nhật ký để xác định các chương trình truy xuất như Wget bằng cách tìm kiếm sự tương đồng có ý nghĩa thống kê về thời gian giữa các yêu cầu. Tùy chọn này làm cho thời gian giữa các yêu cầu khác nhau giữa 0. 5 và 1. 5 * wait seconds, where wait was specified using the ‘--wait’ option, in order to mask Wget’s presence from such analysis

Một bài báo năm 2001 trong một ấn phẩm dành cho phát triển trên nền tảng tiêu dùng phổ biến đã cung cấp mã để thực hiện phân tích này một cách nhanh chóng. Tác giả của nó đã đề xuất chặn ở cấp địa chỉ lớp C để đảm bảo các chương trình truy xuất tự động bị chặn mặc dù đã thay đổi địa chỉ do DHCP cung cấp

Tùy chọn '--random-wait' được lấy cảm hứng từ đề xuất không phù hợp này để chặn nhiều người dùng không liên quan khỏi một trang web do hành động của một

'--không có proxy'

Không sử dụng proxy, ngay cả khi biến môi trường

wget --no-cookies --header "Cookie: name=value"
8 thích hợp đã được xác định

Xem , để biết thêm thông tin về việc sử dụng proxy với Wget

‘-Q hạn ngạch’‘--quota=hạn ngạch’

Chỉ định hạn ngạch tải xuống để truy xuất tự động. Giá trị có thể được chỉ định bằng byte (mặc định), kilobyte (có hậu tố 'k') hoặc megabyte (có hậu tố 'm')

Lưu ý rằng hạn ngạch sẽ không bao giờ ảnh hưởng đến việc tải xuống một tệp. Vì vậy, nếu bạn chỉ định 'wget -Q10k https. //thí dụ. com/ls-lR. gz’, tất cả ls-lR. gz sẽ được tải xuống. Điều tương tự cũng xảy ra ngay cả khi một số URL được chỉ định trên dòng lệnh. Hạn ngạch chỉ được kiểm tra ở cuối mỗi tệp đã tải xuống, vì vậy nó sẽ không bao giờ dẫn đến tệp được tải xuống một phần. Vì vậy, bạn có thể gõ ‘wget -Q2m -i pages’ một cách an toàn—việc tải xuống sẽ bị hủy bỏ sau khi tải xuống hoàn toàn tệp sử dụng hết hạn ngạch

Đặt hạn ngạch thành 0 hoặc thành 'inf' không giới hạn hạn ngạch tải xuống

‘--no-dns-cache’

Turn off caching of DNS lookups. Normally, Wget remembers the IP addresses it looked up from DNS so it doesn’t have to repeatedly contact the DNS server for the same (typically small) set of hosts it retrieves from. This cache exists in memory only; a new Wget run will contact DNS again

However, it has been reported that in some situations it is not desirable to cache host names, even for the duration of a short-running application like Wget. With this option Wget issues a new DNS lookup (more precisely, a new call to

wget --no-cookies --header "Cookie: name=value"
9 or
wget --header='Accept-Charset: iso-8859-2' \
     --header='Accept-Language: hr'        \
       http://fly.srk.fer.hr/
0) each time it makes a new connection. Please note that this option will not affect caching that might be performed by the resolving library or by an external caching layer, such as NSCD

If you don’t understand exactly what this option does, you probably won’t need it

‘--restrict-file-names=modes’

Change which characters found in remote URLs must be escaped during generation of local filenames. Characters that are restricted by this option are escaped, i. e. replaced with ‘%HH’, where ‘HH’ is the hexadecimal number that corresponds to the restricted character. This option may also be used to force all alphabetical cases to be either lower- or uppercase

By default, Wget escapes the characters that are not valid or safe as part of file names on your operating system, as well as control characters that are typically unprintable. This option is useful for changing these defaults, perhaps because you are downloading to a non-native partition, or because you want to disable escaping of the control characters, or you want to further restrict characters to only those in the ASCII range of values

The modes are a comma-separated set of text values. The acceptable values are ‘unix’, ‘windows’, ‘nocontrol’, ‘ascii’, ‘lowercase’, and ‘uppercase’. The values ‘unix’ and ‘windows’ are mutually exclusive (one will override the other), as are ‘lowercase’ and ‘uppercase’. Those last are special cases, as they do not change the set of characters that would be escaped, but rather force local file paths to be converted either to lower- or uppercase

When “unix” is specified, Wget escapes the character ‘/’ and the control characters in the ranges 0–31 and 128–159. This is the default on Unix-like operating systems

When “windows” is given, Wget escapes the characters ‘\’, ‘|’, ‘/’, ‘:’, ‘?’, ‘"’, ‘*’, ‘<’, ‘>’, and the control characters in the ranges 0–31 and 128–159. In addition to this, Wget in Windows mode uses ‘+’ instead of ‘:’ to separate host and port in local file names, and uses ‘@’ instead of ‘?’ to separate the query portion of the file name from the rest. Therefore, a URL that would be saved as ‘www.xemacs.org:4300/search.pl?input=blah’ in Unix mode would be saved as ‘www.xemacs.org+4300/search.pl@input=blah’ in Windows mode. This mode is the default on Windows.

If you specify ‘nocontrol’, then the escaping of the control characters is also switched off. This option may make sense when you are downloading URLs whose names contain UTF-8 characters, on a system which can save and display filenames in UTF-8 (some possible byte values used in UTF-8 byte sequences fall in the range of values designated by Wget as “controls”)

The ‘ascii’ mode is used to specify that any bytes whose values are outside the range of ASCII characters (that is, greater than 127) shall be escaped. This can be useful when saving filenames whose encoding does not match the one used locally

‘-4’‘--inet4-only’‘-6’‘--inet6-only’

Force connecting to IPv4 or IPv6 addresses. With ‘--inet4-only’ or ‘-4’, Wget will only connect to IPv4 hosts, ignoring AAAA records in DNS, and refusing to connect to IPv6 addresses specified in URLs. Conversely, with ‘--inet6-only’ or ‘-6’, Wget will only connect to IPv6 hosts and ignore A records and IPv4 addresses

Neither options should be needed normally. By default, an IPv6-aware Wget will use the address family specified by the host’s DNS record. If the DNS responds with both IPv4 and IPv6 addresses, Wget will try them in sequence until it finds one it can connect to. (Also see

wget --header='Accept-Charset: iso-8859-2' \
     --header='Accept-Language: hr'        \
       http://fly.srk.fer.hr/
1 option described below. )

These options can be used to deliberately force the use of IPv4 or IPv6 address families on dual family systems, usually to aid debugging or to deal with broken network configuration. Only one of ‘--inet6-only’ and ‘--inet4-only’ may be specified at the same time. Neither option is available in Wget compiled without IPv6 support

‘--prefer-family=none/IPv4/IPv6’

When given a choice of several addresses, connect to the addresses with specified address family first. The address order returned by DNS is used without change by default

This avoids spurious errors and connect attempts when accessing hosts that resolve to both IPv6 and IPv4 addresses from IPv4 networks. For example, ‘www. kame. net’ resolves to ‘2001. 200. 0. 8002. 203. 47ff. fea5. 3085’ and to ‘203. 178. 141. 194’. When the preferred family is

wget --header='Accept-Charset: iso-8859-2' \
     --header='Accept-Language: hr'        \
       http://fly.srk.fer.hr/
2, the IPv4 address is used first; when the preferred family is
wget --header='Accept-Charset: iso-8859-2' \
     --header='Accept-Language: hr'        \
       http://fly.srk.fer.hr/
3, the IPv6 address is used first; if the specified value is
wget --header='Accept-Charset: iso-8859-2' \
     --header='Accept-Language: hr'        \
       http://fly.srk.fer.hr/
4, the address order returned by DNS is used without change

Unlike ‘-4’ and ‘-6’, this option doesn’t inhibit access to any address family, it only changes the order in which the addresses are accessed. Also note that the reordering performed by this option is stable—it doesn’t affect order of addresses of the same family. That is, the relative order of all IPv4 addresses and of all IPv6 addresses remains intact in all cases

‘--retry-connrefused’‘--user=user’‘--password=password’

Specify the username user and password password for both FTP and HTTP file retrieval. Các tham số này có thể được ghi đè bằng cách sử dụng các tùy chọn ‘--ftp-user’ và ‘--ftp-password’ cho các kết nối FTP và các tùy chọn ‘--http-user’ và ‘--http-password’ cho các kết nối HTTP

‘--ask-password’

Nhắc mật khẩu cho mỗi kết nối được thiết lập. Cannot be specified when ‘--password’ is being used, because they are mutually exclusive

‘--use-askpass=command’

Prompt for a user and password using the specified command. If no command is specified then the command in the environment variable WGET_ASKPASS is used. If WGET_ASKPASS is not set then the command in the environment variable SSH_ASKPASS is used

You can set the default command for use-askpass in the . wgetrc. That setting may be overridden from the command line

‘--no-iri’

Tắt hỗ trợ URI quốc tế hóa (IRI). Sử dụng '--iri' để bật nó lên. Hỗ trợ IRI được kích hoạt theo mặc định

Bạn có thể đặt trạng thái hỗ trợ IRI mặc định bằng cách sử dụng lệnh

wget --header='Accept-Charset: iso-8859-2' \
     --header='Accept-Language: hr'        \
       http://fly.srk.fer.hr/
5 trong. wgetrc. That setting may be overridden from the command line

‘--local-encoding=encoding’

Force Wget to use encoding as the default system encoding. That affects how Wget converts URLs specified as arguments from locale to UTF-8 for IRI support

Wget use the function

wget --header='Accept-Charset: iso-8859-2' \
     --header='Accept-Language: hr'        \
       http://fly.srk.fer.hr/
6 and then the
wget --header='Accept-Charset: iso-8859-2' \
     --header='Accept-Language: hr'        \
       http://fly.srk.fer.hr/
7 environment variable to get the locale. If it fails, ASCII is used

You can set the default local encoding using the

wget --header='Accept-Charset: iso-8859-2' \
     --header='Accept-Language: hr'        \
       http://fly.srk.fer.hr/
8 command in . wgetrc. That setting may be overridden from the command line

‘--remote-encoding=encoding’

Force Wget to use encoding as the default remote server encoding. That affects how Wget converts URIs found in files from remote encoding to UTF-8 during a recursive fetch. This options is only useful for IRI support, for the interpretation of non-ASCII characters

For HTTP, remote encoding can be found in HTTP

wget --header='Accept-Charset: iso-8859-2' \
     --header='Accept-Language: hr'        \
       http://fly.srk.fer.hr/
9 header and in HTML
wget --header="Host: foo.bar" http://localhost/
0 meta tag

You can set the default encoding using the

wget --header="Host: foo.bar" http://localhost/
1 command in . wgetrc. That setting may be overridden from the command line

‘--unlink’

Force Wget to unlink file instead of clobbering existing file. This option is useful for downloading to the directory with hardlinks


2. 6 Directory Options

‘-nd’‘--no-directories’

Do not create a hierarchy of directories when retrieving recursively. With this option turned on, all files will get saved to the current directory, without clobbering (if a name shows up more than once, the filenames will get extensions ‘. n’)

‘-x’‘--force-directories’

The opposite of ‘-nd’—create a hierarchy of directories, even if one would not have been created otherwise. E. g. ‘wget -x http. //fly. srk. fer. hr/robots. txt’ will save the downloaded file to fly. srk. fer. hr/robots. txt

‘-nH’‘--no-host-directories’

Disable generation of host-prefixed directories. By default, invoking Wget with ‘-r http. //fly. srk. fer. hr/’ will create a structure of directories beginning with fly. srk. fer. hr/. This option disables such behavior

‘--protocol-directories’

Use the protocol name as a directory component of local file names. For example, with this option, ‘wget -r http. //host’ will save to ‘http/host/. ’ rather than just to ‘host/. ’

‘--cut-dirs=number’

Ignore number directory components. This is useful for getting a fine-grained control over the directory where recursive retrieval will be saved

Take, for example, the directory at ‘ftp. //ftp. xemacs. org/pub/xemacs/’. If you retrieve it with ‘-r’, it will be saved locally under ftp. xemacs. org/pub/xemacs/. While the ‘-nH’ option can remove the ftp. xemacs. org/, bạn vẫn bị dính pub/xemacs. This is where ‘--cut-dirs’ comes in handy; it makes Wget not “see” number remote directory components. Here are several examples of how ‘--cut-dirs’ option works

No options        -> ftp.xemacs.org/pub/xemacs/
-nH               -> pub/xemacs/
-nH --cut-dirs=1  -> xemacs/
-nH --cut-dirs=2  -> .

--cut-dirs=1      -> ftp.xemacs.org/xemacs/
...

If you just want to get rid of the directory structure, this option is similar to a combination of ‘-nd’ and ‘-P’. However, unlike ‘-nd’, ‘--cut-dirs’ does not lose with subdirectories—for instance, with ‘-nH --cut-dirs=1’, a beta/ subdirectory will be placed to xemacs/beta, as one would expect

‘-P prefix’‘--directory-prefix=prefix’

Set directory prefix to prefix. The directory prefix is the directory where all other files and subdirectories will be saved to, i. e. the top of the retrieval tree. The default is ‘. ’ (the current directory)


2. 7 HTTP Options

‘--default-page=name’

Use name as the default file name when it isn’t known (i. e. , for URLs that end in a slash), instead of index. html

‘-E’‘--adjust-extension’‘--http-user=user’‘--http-password=password’

Specify the username user and password password on an HTTP server. According to the type of the challenge, Wget will encode them using either the

wget --header="Host: foo.bar" http://localhost/
2 (insecure), the
wget --header="Host: foo.bar" http://localhost/
3, or the Windows
wget --header="Host: foo.bar" http://localhost/
4 authentication scheme

Another way to specify username and password is in the URL itself (see ). Either method reveals your password to anyone who bothers to run

wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
2. To prevent the passwords from being seen, use the ‘--use-askpass’ or store them in . wgetrc or . netrc, and make sure to protect those files from other users with
wget --header="Host: foo.bar" http://localhost/
6. If the passwords are really important, do not leave them lying in those files either—edit the files and delete them after Wget has started the download

‘--no-http-keep-alive’

Turn off the “keep-alive” feature for HTTP downloads. Normally, Wget asks the server to keep the connection open so that, when you download more than one document from the same server, they get transferred over the same TCP connection. This saves time and at the same time reduces the load on the server

This option is useful when, for some reason, persistent (keep-alive) connections don’t work for you, for example due to a server bug or due to the inability of server-side scripts to cope with the connections

‘--no-cache’

Disable server-side cache. In this case, Wget will send the remote server appropriate directives (‘Cache-Control. no-cache’ and ‘Pragma. no-cache’) to get the file from the remote service, rather than returning the cached version. This is especially useful for retrieving and flushing out-of-date documents on proxy servers

Caching is allowed by default

‘--no-cookies’

Disable the use of cookies. Cookies are a mechanism for maintaining server-side state. The server sends the client a cookie using the

wget --header="Host: foo.bar" http://localhost/
7 header, and the client responds with the same cookie upon further requests. Since cookies allow the server owners to keep track of visitors and for sites to exchange this information, some consider them a breach of privacy. The default is to use cookies; however, storing cookies is not on by default

‘--load-cookies file’

Load cookies from file before the first HTTP retrieval. file is a textual file in the format originally used by Netscape’s cookies. txt file

You will typically use this option when mirroring sites that require that you be logged in to access some or all of their content. The login process typically works by the web server issuing an HTTP cookie upon receiving and verifying your credentials. The cookie is then resent by the browser when accessing that part of the site, and so proves your identity

Mirroring such a site requires Wget to send the same cookies your browser sends when communicating with the site. This is achieved by ‘--load-cookies’—simply point Wget to the location of the cookies. txt file, and it will send the same cookies your browser would send in the same situation. Different browsers keep textual cookie files in different locations

Netscape 4. x

The cookies are in ~/. netscape/cookie. txt

Mozilla and Netscape 6. x

Mozilla’s cookie file is also named cookies. txt, located somewhere under ~/. mozilla, trong thư mục hồ sơ của bạn. The full path usually ends up looking somewhat like ~/. mozilla/default/some-weird-string/cookies. txt

Internet Explorer

You can produce a cookie file Wget can use by using the File menu, Import and Export, Export Cookies. This has been tested with Internet Explorer 5; it is not guaranteed to work with earlier versions

Other browsers

If you are using a different browser to create your cookies, ‘--load-cookies’ will only work if you can locate or produce a cookie file in the Netscape format that Wget expects

If you cannot use ‘--load-cookies’, there might still be an alternative. If your browser supports a “cookie manager”, you can use it to view the cookies used when accessing the site you’re mirroring. Write down the name and value of the cookie, and manually instruct Wget to send those cookies, bypassing the “official” cookie support

wget --no-cookies --header "Cookie: name=value"

‘--save-cookies file’

Save cookies to file before exiting. This will not save cookies that have expired or that have no expiry time (so-called “session cookies”), but also see ‘--keep-session-cookies’

‘--keep-session-cookies’‘--ignore-length’‘--header=header-line’

Send header-line along with the rest of the headers in each HTTP request. The supplied header is sent as-is, which means it must contain name and value separated by colon, and must not contain newlines

You may define more than one additional header by specifying ‘--header’ more than once

wget --header='Accept-Charset: iso-8859-2' \
     --header='Accept-Language: hr'        \
       http://fly.srk.fer.hr/

Specification of an empty string as the header value will clear all previous user-defined headers

As of Wget 1. 10, this option can be used to override headers otherwise generated automatically. This example instructs Wget to connect to localhost, but to specify ‘foo. bar’ in the

wget --header="Host: foo.bar" http://localhost/
8 header

wget --header="Host: foo.bar" http://localhost/

In versions of Wget prior to 1. 10 such use of ‘--header’ caused sending of duplicate headers

‘--compression=type’

Choose the type of compression to be used. Legal values are ‘auto’, ‘gzip’ and ‘none’

If ‘auto’ or ‘gzip’ are specified, Wget asks the server to compress the file using the gzip compression format. If the server compresses the file and responds with the

wget --header="Host: foo.bar" http://localhost/
9 header field set appropriately, the file will be decompressed automatically

If ‘none’ is specified, wget will not ask the server to compress the file and will not decompress any server responses. This is the default

Compression support is currently experimental. In case it is turned on, please report any bugs to

ftp://user:password@host/path
http://user:password@host/path
00

‘--max-redirect=number’‘--proxy-user=user’‘--proxy-password=password’

Specify the username user and password password for authentication on a proxy server. Wget will encode them using the

wget --header="Host: foo.bar" http://localhost/
2 authentication scheme

Security considerations similar to those with ‘--http-password’ pertain here as well

‘--referer=url’

Include ‘Referer. url’ header in HTTP request. Useful for retrieving documents with server-side processing that assume they are always being retrieved by interactive web browsers and only come out properly when Referer is set to one of the pages that point to them

‘--save-headers’

Save the headers sent by the HTTP server to the file, preceding the actual contents, with an empty line as the separator

‘-U agent-string’‘--user-agent=agent-string’

Identify as agent-string to the HTTP server

The HTTP protocol allows the clients to identify themselves using a

ftp://user:password@host/path
http://user:password@host/path
02 header field. This enables distinguishing the WWW software, usually for statistical purposes or for tracing of protocol violations. Wget normally identifies as ‘Wget/version’, version being the current version number of Wget

However, some sites have been known to impose the policy of tailoring the output according to the

ftp://user:password@host/path
http://user:password@host/path
02-supplied information. While this is not such a bad idea in theory, it has been abused by servers denying information to clients other than (historically) Netscape or, more frequently, Microsoft Internet Explorer. This option allows you to change the
ftp://user:password@host/path
http://user:password@host/path
02 line issued by Wget. Use of this option is discouraged, unless you really know what you are doing

Specifying empty user agent with ‘--user-agent=""’ instructs Wget not to send the

ftp://user:password@host/path
http://user:password@host/path
02 header in HTTP requests

‘--post-data=string’‘--post-file=file’

Use POST as the method for all HTTP requests and send the specified data in the request body. ‘--post-data’ sends string as data, whereas ‘--post-file’ sends the contents of file. Other than that, they work in exactly the same way. In particular, they both expect content of the form

ftp://user:password@host/path
http://user:password@host/path
06, with percent-encoding for special characters; the only difference is that one expects its content as a command-line parameter and the other accepts its content from a file. In particular, ‘--post-file’ is not for transmitting files as form attachments. those must appear as
ftp://user:password@host/path
http://user:password@host/path
07 data (with appropriate percent-coding) just like everything else. Wget does not currently support
ftp://user:password@host/path
http://user:password@host/path
08 for transmitting POST data; only
ftp://user:password@host/path
http://user:password@host/path
09. Only one of ‘--post-data’ and ‘--post-file’ should be specified

Please note that wget does not require the content to be of the form

ftp://user:password@host/path
http://user:password@host/path
06, and neither does it test for it. Wget will simply transmit whatever data is provided to it. Most servers however expect the POST data to be in the above format when processing HTML Forms

When sending a POST request using the ‘--post-file’ option, Wget treats the file as a binary file and will send every character in the POST request without stripping trailing newline or formfeed characters. Any other control characters in the text will also be sent as-is in the POST request

Please be aware that Wget needs to know the size of the POST data in advance. Therefore the argument to

ftp://user:password@host/path
http://user:password@host/path
11 must be a regular file; specifying a FIFO or something like /dev/stdin won’t work. It’s not quite clear how to work around this limitation inherent in HTTP/1. 0. Although HTTP/1. 1 introduces chunked transfer that doesn’t require knowing the request length in advance, a client can’t use chunked unless it knows it’s talking to an HTTP/1. 1 server. And it can’t know that until it receives a response, which in turn requires the request to have been completed – a chicken-and-egg problem

Note. As of version 1. 15 if Wget is redirected after the POST request is completed, its behaviour will depend on the response code returned by the server. In case of a 301 Moved Permanently, 302 Moved Temporarily or 307 Temporary Redirect, Wget will, in accordance with RFC2616, continue to send a POST request. In case a server wants the client to change the Request method upon redirection, it should send a 303 See Other response code

This example shows how to log in to a server using POST and then proceed to download the desired pages, presumably only accessible to authorized users

ftp://user:password@host/path
http://user:password@host/path
0

If the server is using session cookies to track user authentication, the above will not work because ‘--save-cookies’ will not save them (and neither will browsers) and the cookies. txt file will be empty. In that case use ‘--keep-session-cookies’ along with ‘--save-cookies’ to force saving of session cookies

‘--method=HTTP-Method’

For the purpose of RESTful scripting, Wget allows sending of other HTTP Methods without the need to explicitly set them using ‘--header=Header-Line’. Wget will use whatever string is passed to it after ‘--method’ as the HTTP Method to the server

‘--body-data=Data-String’‘--body-file=Data-File’

Must be set when additional data needs to be sent to the server along with the Method specified using ‘--method’. ‘--body-data’ sends string as data, whereas ‘--body-file’ sends the contents of file. Other than that, they work in exactly the same way

Currently, ‘--body-file’ is not for transmitting files as a whole. Wget does not currently support

ftp://user:password@host/path
http://user:password@host/path
08 for transmitting data; only
ftp://user:password@host/path
http://user:password@host/path
09. In the future, this may be changed so that wget sends the ‘--body-file’ as a complete file instead of sending its contents to the server. Please be aware that Wget needs to know the contents of BODY Data in advance, and hence the argument to ‘--body-file’ should be a regular file. See ‘--post-file’ for a more detailed explanation. Only one of ‘--body-data’ and ‘--body-file’ should be specified

If Wget is redirected after the request is completed, Wget will suspend the current method and send a GET request till the redirection is completed. This is true for all redirection response codes except 307 Temporary Redirect which is used to explicitly specify that the request method should not change. Another exception is when the method is set to

ftp://user:password@host/path
http://user:password@host/path
14, in which case the redirection rules specified under ‘--post-data’ are followed

‘--content-disposition’

If this is set to on, experimental (not fully-functional) support for

ftp://user:password@host/path
http://user:password@host/path
15 headers is enabled. This can currently result in extra round-trips to the server for a
ftp://user:password@host/path
http://user:password@host/path
16 request, and is known to suffer from a few bugs, which is why it is not currently enabled by default

This option is useful for some file-downloading CGI programs that use

ftp://user:password@host/path
http://user:password@host/path
15 headers to describe what the name of a downloaded file should be

When combined with ‘--metalink-over-http’ and ‘--trust-server-names’, a ‘Content-Type. application/metalink4+xml’ file is named using the

ftp://user:password@host/path
http://user:password@host/path
15 filename field, if available

‘--content-on-error’

If this is set to on, wget will not skip the content when the server responds with a http status code that indicates error

‘--trust-server-names’‘--auth-no-challenge’

If this option is given, Wget will send Basic HTTP authentication information (plaintext username and password) for all requests, just like Wget 1. 10. 2 and prior did by default

Use of this option is not recommended, and is intended only to support some few obscure servers, which never send HTTP authentication challenges, but accept unsolicited auth info, say, in addition to form-based authentication

‘--retry-on-host-error’

Consider host errors, such as “Temporary failure in name resolution”, as non-fatal, transient errors

‘--retry-on-http-error=code[,code,. ]’

Consider given HTTP response codes as non-fatal, transient errors. Supply a comma-separated list of 3-digit HTTP response codes as argument. Useful to work around special circumstances where retries are required, but the server responds with an error code normally not retried by Wget. Các lỗi như vậy có thể là 503 (Dịch vụ không khả dụng) và 429 (Quá nhiều yêu cầu). Retries enabled by this option are performed subject to the normal retry timing and retry count limitations of Wget

Using this option is intended to support special use cases only and is generally not recommended, as it can force retries even in cases where the server is actually trying to decrease its load. Please use wisely and only if you know what you are doing


2. 8 HTTPS (SSL/TLS) Options

Để hỗ trợ tải xuống HTTP (HTTPS) được mã hóa, Wget phải được biên dịch bằng thư viện SSL bên ngoài. Mặc định hiện tại là GnuTLS. In addition, Wget also supports HSTS (HTTP Strict Transport Security). If Wget is compiled without SSL support, none of these options are available

‘--secure-protocol=protocol’

Choose the secure protocol to be used. Legal values are ‘auto’, ‘SSLv2’, ‘SSLv3’, ‘TLSv1’, ‘TLSv1_1’, ‘TLSv1_2’, ‘TLSv1_3’ and ‘PFS’. If ‘auto’ is used, the SSL library is given the liberty of choosing the appropriate protocol automatically, which is achieved by sending a TLSv1 greeting. This is the default

Specifying ‘SSLv2’, ‘SSLv3’, ‘TLSv1’, ‘TLSv1_1’, ‘TLSv1_2’ or ‘TLSv1_3’ forces the use of the corresponding protocol. This is useful when talking to old and buggy SSL server implementations that make it hard for the underlying SSL library to choose the correct protocol version. Fortunately, such servers are quite rare

Specifying ‘PFS’ enforces the use of the so-called Perfect Forward Security cipher suites. In short, PFS adds security by creating a one-time key for each SSL connection. It has a bit more CPU impact on client and server. We use known to be secure ciphers (e. g. no MD4) and the TLS protocol. This mode also explicitly excludes non-PFS key exchange methods, such as RSA

‘--https-only’

When in recursive mode, only HTTPS links are followed

‘--ciphers’‘--no-check-certificate’‘--certificate=file’‘--certificate-type=type’

Specify the type of the client certificate. Legal values are ‘PEM’ (assumed by default) and ‘DER’, also known as ‘ASN1’

‘--private-key=file’

Read the private key from file. This allows you to provide the private key in a file separate from the certificate

‘--private-key-type=type’

Specify the type of the private key. Accepted values are ‘PEM’ (the default) and ‘DER’

‘--ca-certificate=file’‘--ca-directory=directory’‘--crl-file=file’

Specifies a CRL file in file. This is needed for certificates that have been revocated by the CAs

‘--pinnedpubkey=file/hashes’

Tells wget to use the specified public key file (or hashes) to verify the peer. This can be a path to a file which contains a single public key in PEM or DER format, or any number of base64 encoded sha256 hashes preceded by “sha256//” and separated by “;”

When negotiating a TLS or SSL connection, the server sends a certificate indicating its identity. A public key is extracted from this certificate and if it does not exactly match the public key(s) provided to this option, wget will abort the connection before sending or receiving any data

‘--random-file=file’

[OpenSSL and LibreSSL only] Use file as the source of random data for seeding the pseudo-random number generator on systems without /dev/urandom

On such systems the SSL library needs an external source of randomness to initialize. Randomness may be provided by EGD (see ‘--egd-file’ below) or read from an external source specified by the user. If this option is not specified, Wget looks for random data in

ftp://user:password@host/path
http://user:password@host/path
19 or, if that is unset, in $HOME/. rnd

If you’re getting the “Could not seed OpenSSL PRNG; disabling SSL. ” error, you should provide random data using some of the methods described above

‘--egd-file=file’

[OpenSSL only] Use file as the EGD socket. EGD stands for Entropy Gathering Daemon, a user-space program that collects data from various unpredictable system sources and makes it available to other programs that might need it. Encryption software, such as the SSL library, needs sources of non-repeating randomness to seed the random number generator used to produce cryptographically strong keys

OpenSSL allows the user to specify his own source of entropy using the

ftp://user:password@host/path
http://user:password@host/path
20 environment variable. If this variable is unset, or if the specified file does not produce enough randomness, OpenSSL will read random data from EGD socket specified using this option

If this option is not specified (and the equivalent startup command is not used), EGD is never contacted. EGD is not needed on modern Unix systems that support /dev/urandom

‘--no-hsts’

Wget supports HSTS (HTTP Strict Transport Security, RFC 6797) by default. Use ‘--no-hsts’ to make Wget act as a non-HSTS-compliant UA. As a consequence, Wget would ignore all the

ftp://user:password@host/path
http://user:password@host/path
21 headers, and would not enforce any existing HSTS policy

‘--hsts-file=file’

By default, Wget stores its HSTS database in ~/. wget-hsts. You can use ‘--hsts-file’ to override this. Wget will use the supplied file as the HSTS database. Such file must conform to the correct HSTS database format used by Wget. If Wget cannot parse the provided file, the behaviour is unspecified

The Wget’s HSTS database is a plain text file. Each line contains an HSTS entry (ie. a site that has issued a

ftp://user:password@host/path
http://user:password@host/path
21 header and that therefore has specified a concrete HSTS policy to be applied). Lines starting with a dash (
ftp://user:password@host/path
http://user:password@host/path
23) are ignored by Wget. Please note that in spite of this convenient human-readability hand-hacking the HSTS database is generally not a good idea

An HSTS entry line consists of several fields separated by one or more whitespace

ftp://user:password@host/path
http://user:password@host/path
24

The hostname and port fields indicate the hostname and port to which the given HSTS policy applies. The port field may be zero, and it will, in most of the cases. That means that the port number will not be taken into account when deciding whether such HSTS policy should be applied on a given request (only the hostname will be evaluated). When port is different to zero, both the target hostname and the port will be evaluated and the HSTS policy will only be applied if both of them match. This feature has been included for testing/development purposes only. The Wget testsuite (in testenv/) creates HSTS databases with explicit ports with the purpose of ensuring Wget’s correct behaviour. Applying HSTS policies to ports other than the default ones is discouraged by RFC 6797 (see Appendix B "Differences between HSTS Policy and Same-Origin Policy"). Thus, this functionality should not be used in production environments and port will typically be zero. The last three fields do what they are expected to. The field include_subdomains can either be

ftp://user:password@host/path
http://user:password@host/path
25 or
ftp://user:password@host/path
http://user:password@host/path
26 and it signals whether the subdomains of the target domain should be part of the given HSTS policy as well. The created and max-age fields hold the timestamp values of when such entry was created (first seen by Wget) and the HSTS-defined value ’max-age’, which states how long should that HSTS policy remain active, measured in seconds elapsed since the timestamp stored in created. Once that time has passed, that HSTS policy will no longer be valid and will eventually be removed from the database

If you supply your own HSTS database via ‘--hsts-file’, be aware that Wget may modify the provided file if any change occurs between the HSTS policies requested by the remote servers and those in the file. When Wget exits, it effectively updates the HSTS database by rewriting the database file with the new entries

If the supplied file does not exist, Wget will create one. This file will contain the new HSTS entries. If no HSTS entries were generated (no

ftp://user:password@host/path
http://user:password@host/path
21 headers were sent by any of the servers) then no file will be created, not even an empty one. This behaviour applies to the default database file (~/. wget-hsts) as well. it will not be created until some server enforces an HSTS policy

Care is taken not to override possible changes made by other Wget processes at the same time over the HSTS database. Before dumping the updated HSTS entries on the file, Wget will re-read it and merge the changes

Using a custom HSTS database and/or modifying an existing one is discouraged. For more information about the potential security threats arose from such practice, see section 14 "Security Considerations" of RFC 6797, specially section 14. 9 "Creative Manipulation of HSTS Policy Store"

'--warc-tệp=tệp'

Sử dụng tệp làm tệp WARC đích

‘--warc-header=string’

Use string into as the warcinfo record

‘--warc-max-size=size’

Set the maximum size of the WARC files to size

‘--warc-cdx’

Write CDX index files

'--warc-dedup=tệp'

Do not store records listed in this CDX file

‘--no-warc-compression’

Do not compress WARC files with GZIP

‘--no-warc-digests’

Do not calculate SHA1 digests

‘--no-warc-keep-log’

Do not store the log file in a WARC record

‘--warc-tempdir=dir’

Specify the location for temporary files created by the WARC writer


2. 9 FTP Options

‘--ftp-user=user’‘--ftp-password=password’

Specify the username user and password password on an FTP server. Without this, or the corresponding startup option, the password defaults to ‘-wget@’, normally used for anonymous FTP

Another way to specify username and password is in the URL itself (see ). Either method reveals your password to anyone who bothers to run

wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
2. To prevent the passwords from being seen, store them in . wgetrc or . netrc, and make sure to protect those files from other users with
wget --header="Host: foo.bar" http://localhost/
6. If the passwords are really important, do not leave them lying in those files either—edit the files and delete them after Wget has started the download

‘--no-remove-listing’

Don’t remove the temporary . listing files generated by FTP retrievals. Normally, these files contain the raw directory listings received from FTP servers. Not removing them can be useful for debugging purposes, or when you want to be able to easily check on the contents of remote server directories (e. g. to verify that a mirror you’re running is complete)

Note that even though Wget writes to a known filename for this file, this is not a security hole in the scenario of a user making . listing a symbolic link to /etc/passwd or something and asking

ftp://user:password@host/path
http://user:password@host/path
30 to run Wget in his or her directory. Depending on the options used, either Wget will refuse to write to . listing, making the globbing/recursion/time-stamping operation fail, or the symbolic link will be deleted and replaced with the actual . listing file, or the listing will be written to a . listing. number file

Even though this situation isn’t a problem, though,

ftp://user:password@host/path
http://user:password@host/path
30 should never run Wget in a non-trusted user’s directory. A user could do something as simple as linking index. html to /etc/passwd and asking
ftp://user:password@host/path
http://user:password@host/path
30 to run Wget with ‘-N’ or ‘-r’ so the file will be overwritten

‘--no-glob’

Turn off FTP globbing. Globbing refers to the use of shell-like special characters (wildcards), like ‘*’, ‘?’, ‘[’ and ‘]’ to retrieve more than one file from the same directory at once, like

ftp://user:password@host/path
http://user:password@host/path
1

By default, globbing will be turned on if the URL contains a globbing character. This option may be used to turn globbing on or off permanently

You may have to quote the URL to protect it from being expanded by your shell. Globbing makes Wget look for a directory listing, which is system-specific. This is why it currently works only with Unix FTP servers (and the ones emulating Unix

ftp://user:password@host/path
http://user:password@host/path
33 output)

‘--no-passive-ftp’

Disable the use of the passive FTP transfer mode. Passive FTP mandates that the client connect to the server to establish the data connection rather than the other way around

If the machine is connected to the Internet directly, both passive and active FTP should work equally well. Behind most firewall and NAT configurations passive FTP has a better chance of working. However, in some rare firewall configurations, active FTP actually works when passive FTP doesn’t. If you suspect this to be the case, use this option, or set

ftp://user:password@host/path
http://user:password@host/path
34 in your init file

‘--preserve-permissions’‘--retr-symlinks’

By default, when retrieving FTP directories recursively and a symbolic link is encountered, the symbolic link is traversed and the pointed-to files are retrieved. Currently, Wget does not traverse symbolic links to directories to download them recursively, though this feature may be added in the future

When ‘--retr-symlinks=no’ is specified, the linked-to file is not downloaded. Instead, a matching symbolic link is created on the local filesystem. The pointed-to file will not be retrieved unless this recursive retrieval would have encountered it separately and downloaded it anyway. This option poses a security risk where a malicious FTP Server may cause Wget to write to files outside of the intended directories through a specially crafted . LISTING file

Note that when retrieving a file (not a directory) because it was specified on the command-line, rather than because it was recursed to, this option has no effect. Symbolic links are always traversed in this case

2. 10 FTPS Options

‘--ftps-implicit’

This option tells Wget to use FTPS implicitly. Implicit FTPS consists of initializing SSL/TLS from the very beginning of the control connection. This option does not send an

ftp://user:password@host/path
http://user:password@host/path
35 command. it assumes the server speaks FTPS and directly starts an SSL/TLS connection. If the attempt is successful, the session continues just like regular FTPS (
ftp://user:password@host/path
http://user:password@host/path
36 and
ftp://user:password@host/path
http://user:password@host/path
37 are sent, etc. ). Implicit FTPS is no longer a requirement for FTPS implementations, and thus many servers may not support it. If ‘--ftps-implicit’ is passed and no explicit port number specified, the default port for implicit FTPS, 990, will be used, instead of the default port for the "normal" (explicit) FTPS which is the same as that of FTP, 21

‘--no-ftps-resume-ssl’

Do not resume the SSL/TLS session in the data channel. When starting a data connection, Wget tries to resume the SSL/TLS session previously started in the control connection. SSL/TLS session resumption avoids performing an entirely new handshake by reusing the SSL/TLS parameters of a previous session. Typically, the FTPS servers want it that way, so Wget does this by default. Under rare circumstances however, one might want to start an entirely new SSL/TLS session in every data connection. This is what ‘--no-ftps-resume-ssl’ is for

‘--ftps-clear-data-connection’

All the data connections will be in plain text. Only the control connection will be under SSL/TLS. Wget will send a

ftp://user:password@host/path
http://user:password@host/path
38 command to achieve this, which must be approved by the server

‘--ftps-fallback-to-ftp’

Fall back to FTP if FTPS is not supported by the target server. For security reasons, this option is not asserted by default. The default behaviour is to exit with an error. If a server does not successfully reply to the initial

ftp://user:password@host/path
http://user:password@host/path
35 command, or in the case of implicit FTPS, if the initial SSL/TLS connection attempt is rejected, it is considered that such server does not support FTPS


2. 11 Recursive Retrieval Options

‘-r’‘--recursive’

Turn on recursive retrieving. See , for more details. The default maximum depth is 5

‘-l depth’‘--level=depth’

Set the maximum number of subdirectories that Wget will recurse into to depth. In order to prevent one from accidentally downloading very large websites when using recursion this is limited to a depth of 5 by default, i. e. , it will traverse at most 5 directories deep starting from the provided URL. Set ‘-l 0’ or ‘-l inf’ for infinite recursion depth

ftp://user:password@host/path
http://user:password@host/path
2

Ideally, one would expect this to download just 1. html. but unfortunately this is not the case, because ‘-l 0’ is equivalent to ‘-l inf’—that is, infinite recursion. To download a single HTML page (or a handful of them), specify them all on the command line and leave away ‘-r’ and ‘-l’. To download the essential items to view a single HTML page, see ‘page requisites’

‘--delete-after’‘-k’‘--convert-links’

After the download is complete, convert the links in the document to make them suitable for local viewing. This affects not only the visible hyperlinks, but any part of the document that links to external content, such as embedded images, links to style sheets, hyperlinks to non-HTML content, etc

Mỗi liên kết sẽ được thay đổi theo một trong hai cách

  • The links to files that have been downloaded by Wget will be changed to refer to the file they point to as a relative link

    Example. nếu tệp đã tải xuống /foo/doc. html links to /bar/img. gif, also downloaded, then the link in doc. html will be modified to point to ‘. /bar/img. gif'. This kind of transformation works reliably for arbitrary combinations of directories

  • Các liên kết đến các tệp chưa được Wget tải xuống sẽ được thay đổi để bao gồm tên máy chủ và đường dẫn tuyệt đối của vị trí mà chúng trỏ đến

    Example. if the downloaded file /foo/doc. html links to /bar/img. gif (or to . /bar/img. gif), then the link in doc. html will be modified to point to http. //hostname/bar/img. gif

Because of this, local browsing works reliably. if a linked file was downloaded, the link will refer to its local name; if it was not downloaded, the link will refer to its full Internet address rather than presenting a broken link. The fact that the former links are converted to relative links ensures that you can move the downloaded hierarchy to another directory

Note that only at the end of the download can Wget know which links have been downloaded. Because of that, the work done by ‘-k’ will be performed at the end of all the downloads

‘--convert-file-only’

This option converts only the filename part of the URLs, leaving the rest of the URLs untouched. This filename part is sometimes referred to as the "basename", although we avoid that term here in order not to cause confusion

It works particularly well in conjunction with ‘--adjust-extension’, although this coupling is not enforced. It proves useful to populate Internet caches with files downloaded from different hosts

Example. if some link points to //foo. com/bar. cgi?xyz with ‘--adjust-extension’ asserted and its local destination is intended to be . /foo. com/bar. cgi?xyz. css, then the link would be converted to //foo. com/bar. cgi?xyz. css. Note that only the filename part has been modified. The rest of the URL has been left untouched, including the net path (

ftp://user:password@host/path
http://user:password@host/path
40) which would otherwise be processed by Wget and converted to the effective scheme (ie.
ftp://user:password@host/path
http://user:password@host/path
41)

‘-K’‘--backup-converted’

When converting a file, back up the original version with a ‘. orig’ suffix. Affects the behavior of ‘-N’ (see )

‘-m’‘--mirror’

Turn on options suitable for mirroring. This option turns on recursion and time-stamping, sets infinite recursion depth and keeps FTP directory listings. It is currently equivalent to ‘-r -N -l inf --no-remove-listing’

‘-p’‘--page-requisites’‘--strict-comments’

Turn on strict parsing of HTML comments. The default is to terminate comments at the first occurrence of ‘-->’

According to specifications, HTML comments are expressed as SGML declarations. Declaration is special markup that begins with ‘’ and ends with ‘>’, such as ‘’, that may contain comments between a pair of ‘--’ delimiters. HTML comments are “empty declarations”, SGML declarations without any non-comment text. Therefore, ‘’ is a valid comment, and so is ‘’, but ‘’ is not

On the other hand, most HTML writers don’t perceive comments as anything other than text delimited with ‘’, which is not quite the same. For example, something like ‘’ works as a valid comment as long as the number of dashes is a multiple of four (. ). If not, the comment technically lasts until the next ‘--’, which may be at the other end of the document. Because of this, many popular browsers completely ignore the specification and implement what users have come to expect. comments delimited with ‘’

Until version 1. 9, Wget interpreted comments strictly, which resulted in missing links in many web pages that displayed fine in browsers, but had the misfortune of containing non-compliant comments. Beginning with version 1. 9, Wget has joined the ranks of clients that implements “naive” comments, terminating each comment at the first occurrence of ‘-->’

If, for whatever reason, you want strict comment parsing, use this option to turn it on


2. 12 Recursive Accept/Reject Options

‘-A acclist --accept acclist’‘-R rejlist --reject rejlist’

Specify comma-separated lists of file name suffixes or patterns to accept or reject (see ). Note that if any of the wildcard characters, ‘*’, ‘?’, ‘[’ or ‘]’, appear in an element of acclist or rejlist, it will be treated as a pattern, rather than a suffix. In this case, you have to enclose the pattern into quotes to prevent your shell from expanding it, like in ‘-A "*. mp3"’ or ‘-A '*. mp3'’

‘--accept-regex urlregex’‘--reject-regex urlregex’

Specify a regular expression to accept or reject the complete URL

‘--regex-type regextype’

Specify the regular expression type. Possible types are ‘posix’ or ‘pcre’. Note that to be able to use ‘pcre’ type, wget has to be compiled with libpcre support

‘-D domain-list’‘--domains=domain-list’

Set domains to be followed. domain-list is a comma-separated list of domains. Note that it does not turn on ‘-H’

‘--exclude-domains domain-list’‘--follow-ftp’

Follow FTP links from HTML documents. Without this option, Wget will ignore all the FTP links

‘--follow-tags=list’

Wget has an internal table of HTML tag / attribute pairs that it considers when looking for linked documents during a recursive retrieval. If a user wants only a subset of those tags to be considered, however, he or she should be specify such tags in a comma-separated list with this option

‘--ignore-tags=list’‘--ignore-case’

Ignore case when matching files and directories. This influences the behavior of -R, -A, -I, and -X options, as well as globbing implemented when downloading from FTP sites. For example, with this option, ‘-A "*. txt"’ will match ‘file1. txt’, but also ‘file2. TXT’, ‘file3. TxT’, and so on. The quotes in the example are to prevent the shell from expanding the pattern

‘-H’‘--span-hosts’

Enable spanning across hosts when doing recursive retrieving (see )

‘-L’‘--relative’

Follow relative links only. Hữu ích khi truy xuất một trang chủ cụ thể mà không có bất kỳ phiền nhiễu nào, kể cả những trang từ cùng một máy chủ (xem phần )

‘-I list’‘--include-directories=list’

Specify a comma-separated list of directories you wish to follow when downloading (see ). Elements of list may contain wildcards

‘-X list’‘--exclude-directories=list’

Chỉ định danh sách các thư mục được phân tách bằng dấu phẩy mà bạn muốn loại trừ khỏi quá trình tải xuống (xem ). Các phần tử của danh sách có thể chứa ký tự đại diện

‘-np’‘--no-parent’

Do not ever ascend to the parent directory when retrieving recursively. This is a useful option, since it guarantees that only the files below a certain hierarchy will be downloaded. See , for more details


2. 13 Trạng thái thoát

Wget may return one of several error codes if it encounters problems

0

No problems occurred

1

Generic error code

2

Parse error—for instance, when parsing command-line options, the ‘. wgetrc’ or ‘. netrc’

3

File I/O error

4

Network failure

5

SSL verification failure

6

Username/password authentication failure

7

Protocol errors

8

Server issued an error response

With the exceptions of 0 and 1, the lower-numbered exit codes take precedence over higher-numbered ones, when multiple types of errors are encountered

In versions of Wget prior to 1. 12, Wget’s exit status tended to be unhelpful and inconsistent. Recursive downloads would virtually always return 0 (success), regardless of any issues encountered, and non-recursive fetches only returned the status corresponding to the most recently-attempted download


3 Recursive Download

GNU Wget is capable of traversing parts of the Web (or a single HTTP or FTP server), following links and directory structure. We refer to this as to recursive retrieval, or recursion

With HTTP URLs, Wget retrieves and parses the HTML or CSS from the given URL, retrieving the files the document refers to, through markup like

No options        -> ftp.xemacs.org/pub/xemacs/
-nH               -> pub/xemacs/
-nH --cut-dirs=1  -> xemacs/
-nH --cut-dirs=2  -> .

--cut-dirs=1      -> ftp.xemacs.org/xemacs/
...
4 or
ftp://user:password@host/path
http://user:password@host/path
43, or CSS URI values specified using the ‘url()’ functional notation. If the freshly downloaded file is also of type
ftp://user:password@host/path
http://user:password@host/path
44,
ftp://user:password@host/path
http://user:password@host/path
45, or
ftp://user:password@host/path
http://user:password@host/path
46, it will be parsed and followed further

Recursive retrieval of HTTP and HTML/CSS content is breadth-first. This means that Wget first downloads the requested document, then the documents linked from that document, then the documents linked by them, and so on. In other words, Wget first downloads the documents at depth 1, then those at depth 2, and so on until the specified maximum depth

The maximum depth to which the retrieval may descend is specified with the ‘-l’ option. The default maximum depth is five layers

When retrieving an FTP URL recursively, Wget will retrieve all the data from the given directory tree (including the subdirectories up to the specified depth) on the remote server, creating its mirror image locally. FTP retrieval is also limited by the

ftp://user:password@host/path
http://user:password@host/path
47 parameter. Unlike HTTP recursion, FTP recursion is performed depth-first

By default, Wget will create a local directory tree, corresponding to the one found on the remote server

Recursive retrieving can find a number of applications, the most important of which is mirroring. It is also useful for WWW presentations, and any other opportunities where slow network connections should be bypassed by storing the files locally

You should be warned that recursive downloads can overload the remote servers. Because of that, many administrators frown upon them and may ban access from your site if they detect very fast downloads of big amounts of content. When downloading from Internet servers, consider using the ‘-w’ option to introduce a delay between accesses to the server. The download will take a while longer, but the server administrator will not be alarmed by your rudeness

Of course, recursive download may cause problems on your machine. If left to run unchecked, it can easily fill up the disk. If downloading from local network, it can also take bandwidth on the system, as well as consume memory and CPU

Try to specify the criteria that match the kind of download you are trying to achieve. If you want to download only one page, use ‘--page-requisites’ without any additional recursion. If you want to download things under one directory, use ‘-np’ to avoid downloading things from other directories. If you want to download all the files from one directory, use ‘-l 1’ to make sure the recursion depth never exceeds one. See , for more information about this

Recursive retrieval should be used with care. Don’t say you were not warned


When retrieving recursively, one does not wish to retrieve loads of unnecessary data. Most of the time the users bear in mind exactly what they want to download, and want Wget to follow only specific links

For example, if you wish to download the music archive from ‘fly. srk. fer. hr’, you will not want to download all the home pages that happen to be referenced by an obscure part of the archive

Wget possesses several mechanisms that allows you to fine-tune which links it will follow


4. 1 máy chủ kéo dài

Wget’s recursive retrieval normally refuses to visit hosts different than the one you specified on the command line. This is a reasonable default; without it, every retrieval would have the potential to turn your Wget into a small version of google

However, visiting different hosts, or host spanning, is sometimes a useful option. Maybe the images are served from a different server. Maybe you’re mirroring a site that consists of pages interlinked between three servers. Maybe the server has two equivalent names, and the HTML pages refer to both interchangeably

Span to any host—‘-H’

The ‘-H’ option turns on host spanning, thus allowing Wget’s recursive run to visit any host referenced by a link. Unless sufficient recursion-limiting criteria are applied depth, these foreign hosts will typically link to yet more hosts, and so on until Wget ends up sucking up much more data than you have intended

Limit spanning to certain domains—‘-D’

The ‘-D’ option allows you to specify the domains that will be followed, thus limiting the recursion only to the hosts that belong to these domains. Obviously, this makes sense only in conjunction with ‘-H’. A typical example would be downloading the contents of ‘www. example. com’, but allowing downloads from ‘images. example. com’, etc

ftp://user:password@host/path
http://user:password@host/path
3

You can specify more than one address by separating them with a comma, e. g. ‘-Ddomain1. com,domain2. com’

Keep download off certain domains—‘--exclude-domains’

If there are domains you want to exclude specifically, you can do it with ‘--exclude-domains’, which accepts the same type of arguments of ‘-D’, but will exclude all the listed domains. Ví dụ: nếu bạn muốn tải xuống tất cả các máy chủ lưu trữ từ 'foo. edu’, ngoại trừ ‘sunsite. foo. edu’, you can do it like this

ftp://user:password@host/path
http://user:password@host/path
4


4. 2 Types of Files

When downloading material from the web, you will often want to restrict the retrieval to only certain file types. For example, if you are interested in downloading GIFs, you will not be overjoyed to get loads of PostScript documents, and vice versa

Wget offers two options to deal with this problem. Each option description lists a short name, a long name, and the equivalent command in . wgetrc

‘-A acclist’‘--accept acclist’‘accept = acclist’‘--accept-regex urlregex’‘accept-regex = urlregex’

The argument to ‘--accept’ option is a list of file suffixes or patterns that Wget will download during recursive retrieval. Hậu tố là phần kết thúc của một tệp và bao gồm các chữ cái "bình thường", e. g. 'gif' hoặc '. jpg'. Một mẫu phù hợp chứa các ký tự đại diện giống như vỏ, e. g. 'sách*' hoặc 'zelazny*196[0-9]*'

So, specifying ‘wget -A gif,jpg’ will make Wget download only the files ending with ‘gif’ or ‘jpg’, i. e. GIF và JPEG. Mặt khác, ‘wget -A "zelazny*196[0-9]*"' sẽ chỉ tải xuống các tệp bắt đầu bằng 'zelazny' và chứa các số từ 1960 đến 1969 ở bất kỳ đâu trong. Tra cứu hướng dẫn sử dụng shell của bạn để biết mô tả về cách thức hoạt động của khớp mẫu

Tất nhiên, bất kỳ số lượng hậu tố và mẫu nào cũng có thể được kết hợp thành một danh sách được phân tách bằng dấu phẩy và được đưa ra làm đối số cho '-A'

Đối số cho tùy chọn '--accept-regex' là một biểu thức chính quy được khớp với URL hoàn chỉnh

‘-R rejlist’‘--reject rejlist’‘reject = rejlist’‘--reject-regex urlregex’‘reject-regex = urlregex’

Tùy chọn '--reject' hoạt động giống như tùy chọn '--accept', chỉ có logic của nó là ngược lại;

Vì vậy, nếu bạn muốn tải xuống toàn bộ trang ngoại trừ MPEG và. AU, bạn có thể sử dụng 'wget -R mpg,mpeg,au'. Tương tự, để tải xuống tất cả các tệp ngoại trừ những tệp bắt đầu bằng ‘bjork’, hãy sử dụng ‘wget -R "bjork*"'. Các dấu ngoặc kép là để ngăn chặn sự mở rộng của shell

Đối số cho tùy chọn '--accept-regex' là một biểu thức chính quy được khớp với URL hoàn chỉnh

Các tùy chọn '-A' và '-R' có thể được kết hợp để đạt được khả năng tinh chỉnh tốt hơn nữa đối với các tệp cần truy xuất. e. g. ‘wget -A "*zelazny*" -R. ps' sẽ tải xuống tất cả các tệp có 'zelazny' như một phần tên của chúng, nhưng không tải xuống các tệp PostScript

Lưu ý rằng hai tùy chọn này không ảnh hưởng đến việc tải xuống tệp HTML (như được xác định bởi dấu ‘. htm' hoặc '. html’ filename prefix). This behavior may not be desirable for all users, and may be changed for future versions of Wget

Note, too, that query strings (strings at the end of a URL beginning with a question mark (‘?’) are not included as part of the filename for accept/reject rules, even though these will actually contribute to the name chosen for the local file. It is expected that a future version of Wget will provide an option to allow matching against query strings

Finally, it’s worth noting that the accept/reject lists are matched twice against downloaded files. once against the URL’s filename portion, to determine if the file should be downloaded in the first place; then, after it has been accepted and successfully downloaded, the local file’s name is also checked against the accept/reject lists to see if it should be removed. The rationale was that, since ‘. htm’ and ‘. html’ files are always downloaded regardless of accept/reject rules, they should be removed after being downloaded and scanned for links, if they did match the accept/reject lists. However, this can lead to unexpected results, since the local filenames can differ from the original URL filenames in the following ways, all of which can change whether an accept/reject rule matches

  • If the local file already exists and ‘--no-directories’ was specified, a numeric suffix will be appended to the original name
  • If ‘--adjust-extension’ was specified, the local filename might have ‘. html’ appended to it. If Wget is invoked with ‘-E -A. php’, a filename such as ‘index. php’ will match be accepted, but upon download will be named ‘index. php. html’, which no longer matches, and so the file will be deleted
  • Query strings do not contribute to URL matching, but are included in local filenames, and so do contribute to filename matching

This behavior, too, is considered less-than-desirable, and may change in a future version of Wget


4. 3 Directory-Based Limits

Regardless of other link-following facilities, it is often useful to place the restriction of what files to retrieve based on the directories those files are placed in. There can be many reasons for this—the home pages may be organized in a reasonable directory structure; or some directories may contain useless information, e. g. /cgi-bin or /dev directories

Wget offers three different options to deal with this requirement. Each option description lists a short name, a long name, and the equivalent command in . wgetrc

‘-I list’‘--include list’‘include_directories = list’

‘-I’ option accepts a comma-separated list of directories included in the retrieval. Any other directories will simply be ignored. The directories are absolute paths

So, if you wish to download from ‘http. //host/people/bozo/’ following only links to bozo’s colleagues in the /people directory and the bogus scripts in /cgi-bin, you can specify

ftp://user:password@host/path
http://user:password@host/path
5

‘-X list’‘--exclude list’‘exclude_directories = list’

‘-X’ option is exactly the reverse of ‘-I’—this is a list of directories excluded from the download. E. g. if you do not want Wget to download things from /cgi-bin directory, specify ‘-X /cgi-bin’ on the command line

The same as with ‘-A’/‘-R’, these two options can be combined to get a better fine-tuning of downloading subdirectories. E. g. if you want to load all the files from /pub hierarchy except for /pub/worthless, specify ‘-I/pub -X/pub/worthless’

‘-np’‘--no-parent’‘no_parent = on’

The simplest, and often very useful way of limiting directories is disallowing retrieval of the links that refer to the hierarchy above than the beginning directory, i. e. disallowing ascent to the parent directory/directories

The ‘--no-parent’ option (short ‘-np’) is useful in this case. Using it guarantees that you will never leave the existing hierarchy. Supposing you issue Wget with

ftp://user:password@host/path
http://user:password@host/path
6

You may rest assured that none of the references to /~his-girls-homepage/ or /~luzer/all-my-mpegs/ will be followed. Only the archive you are interested in will be downloaded. Essentially, ‘--no-parent’ is similar to ‘-I/~luzer/my-archive’, only it handles redirections in a more intelligent fashion

Note that, for HTTP (and HTTPS), the trailing slash is very important to ‘--no-parent’. HTTP has no concept of a “directory”—Wget relies on you to indicate what’s a directory and what isn’t. In ‘http. //foo/bar/’, Wget will consider ‘bar’ to be a directory, while in ‘http. //foo/bar’ (no trailing slash), ‘bar’ will be considered a filename (so ‘--no-parent’ would be meaningless, as its parent is ‘/’)


When ‘-L’ is turned on, only the relative links are ever followed. Relative links are here defined those that do not refer to the web server root. For example, these links are relative

ftp://user:password@host/path
http://user:password@host/path
7

These links are not relative

ftp://user:password@host/path
http://user:password@host/path
8

Using this option guarantees that recursive retrieval will not span hosts, even without ‘-H’. In simple cases it also allows downloads to “just work” without having to convert links

This option is probably not very useful and might be removed in a future release


The rules for FTP are somewhat specific, as it is necessary for them to be. FTP links in HTML documents are often included for purposes of reference, and it is often inconvenient to download them by default

To have FTP links followed from HTML documents, you need to specify the ‘--follow-ftp’ option. Having done that, FTP links will span hosts regardless of ‘-H’ setting. This is logical, as FTP links rarely point to the same host where the HTTP server resides. Vì những lý do tương tự, các tùy chọn '-L' không ảnh hưởng đến các lượt tải xuống đó. On the other hand, domain acceptance (‘-D’) and suffix rules (‘-A’ and ‘-R’) apply normally

Also note that followed links to FTP directories will not be retrieved recursively further


5 Time-Stamping

One of the most important aspects of mirroring information from the Internet is updating your archives

Tải đi tải lại toàn bộ kho lưu trữ, chỉ để thay thế một vài tệp đã thay đổi là rất tốn kém, cả về lãng phí băng thông và tiền bạc cũng như thời gian để cập nhật. This is why all the mirroring tools offer the option of incremental updating

Such an updating mechanism means that the remote server is scanned in search of new files. Only those new files will be downloaded in the place of the old ones

A file is considered new if one of these two conditions are met

  1. A file of that name does not already exist locally
  2. A file of that name does exist, but the remote file was modified more recently than the local file

To implement this, the program needs to be aware of the time of last modification of both local and remote files. We call this information the time-stamp of a file

The time-stamping in GNU Wget is turned on using ‘--timestamping’ (‘-N’) option, or through

ftp://user:password@host/path
http://user:password@host/path
48 directive in . wgetrc. With this option, for each file it intends to download, Wget will check whether a local file of the same name exists. If it does, and the remote file is not newer, Wget will not download it

If the local file does not exist, or the sizes of the files do not match, Wget will download the remote file no matter what the time-stamps say


5. 1 Time-Stamping Usage

The usage of time-stamping is simple. Say you would like to download a file so that it keeps its date of modification

ftp://user:password@host/path
http://user:password@host/path
9

A simple

ftp://user:password@host/path
http://user:password@host/path
49 shows that the time stamp on the local file equals the state of the
ftp://user:password@host/path
http://user:password@host/path
50 header, as returned by the server. As you can see, the time-stamping info is preserved locally, even without ‘-N’ (at least for HTTP)

Several days later, you would like Wget to check if the remote file has changed, and download it if it has

ftp://host/directory/file;type=a
0

Wget will ask the server for the last-modified date. If the local file has the same timestamp as the server, or a newer one, the remote file will not be re-fetched. However, if the remote file is more recent, Wget will proceed to fetch it

The same goes for FTP. For example

ftp://host/directory/file;type=a
1

(The quotes around that URL are to prevent the shell from trying to interpret the ‘*’. )

After download, a local directory listing will show that the timestamps match those on the remote server. Reissuing the command with ‘-N’ will make Wget re-fetch only the files that have been modified since the last download

If you wished to mirror the GNU archive every week, you would use a command like the following, weekly

ftp://host/directory/file;type=a
2

Note that time-stamping will only work for files for which the server gives a timestamp. For HTTP, this depends on getting a

ftp://user:password@host/path
http://user:password@host/path
50 header. For FTP, this depends on getting a directory listing with dates in a format that Wget can parse (see )


5. 2 HTTP Time-Stamping Internals

Time-stamping in HTTP is implemented by checking of the

ftp://user:password@host/path
http://user:password@host/path
50 header. If you wish to retrieve the file foo. html through HTTP, Wget will check whether foo. html exists locally. If it doesn’t, foo. html will be retrieved unconditionally

If the file does exist locally, Wget will first check its local time-stamp (similar to the way

ftp://user:password@host/path
http://user:password@host/path
49 checks it), and then send a
ftp://user:password@host/path
http://user:password@host/path
16 request to the remote server, demanding the information on the remote file

The

ftp://user:password@host/path
http://user:password@host/path
50 header is examined to find which file was modified more recently (which makes it “newer”). If the remote file is newer, it will be downloaded; if it is older, Wget will give up

When ‘--backup-converted’ (‘-K’) is specified in conjunction with ‘-N’, server file ‘X’ is compared to local file ‘X. orig’, if extant, rather than being compared to local file ‘X’, which will always differ if it’s been converted by ‘--convert-links’ (‘-k’)

Arguably, HTTP time-stamping should be implemented using the

ftp://user:password@host/path
http://user:password@host/path
56 request


5. 3 FTP Time-Stamping Internals

Về lý thuyết, tem thời gian của FTP hoạt động giống như HTTP, chỉ khác là FTP không có tiêu đề—dấu thời gian phải được đưa ra khỏi danh sách thư mục

If an FTP download is recursive or uses globbing, Wget will use the FTP

ftp://user:password@host/path
http://user:password@host/path
57 command to get a file listing for the directory containing the desired file(s). It will try to analyze the listing, treating it like Unix
ftp://user:password@host/path
http://user:password@host/path
49 output, extracting the time-stamps. The rest is exactly the same as for HTTP. Note that when retrieving individual files from an FTP server without using globbing or recursion, listing files will not be downloaded (and thus files will not be time-stamped) unless ‘-N’ is specified

Assumption that every directory listing is a Unix-style listing may sound extremely constraining, but in practice it is not, as many non-Unix FTP servers use the Unixoid listing format because most (all?) of the clients understand it. Bear in mind that RFC959 defines no standard way to get a file list, let alone the time-stamps. We can only hope that a future standard will define this

Another non-standard solution includes the use of

ftp://user:password@host/path
http://user:password@host/path
59 command that is supported by some FTP servers (including the popular
ftp://user:password@host/path
http://user:password@host/path
60), which returns the exact time of the specified file. Wget may support this command in the future


6 Startup File

Once you know how to change default settings of Wget through command line arguments, you may wish to make some of those settings permanent. You can do that in a convenient way by creating the Wget startup file—. wgetrc

Besides . wgetrc is the “main” initialization file, it is convenient to have a special facility for storing passwords. Thus Wget reads and interprets the contents of $HOME/. netrc, if it finds it. You can find . netrc format in your system manuals

Wget reads . wgetrc upon startup, recognizing a limited set of commands


6. 1 Wgetrc Location

When initializing, Wget will look for a global startup file, /usr/local/etc/wgetrc by default (or some prefix other than /usr/local, if Wget was not installed there) and read commands from there, if it exists

Then it will look for the user’s file. If the environmental variable

ftp://user:password@host/path
http://user:password@host/path
61 is set, Wget will try to load that file. Failing that, no further attempts will be made

If

ftp://user:password@host/path
http://user:password@host/path
61 is not set, Wget will try to load $HOME/. wgetrc

The fact that user’s settings are loaded after the system-wide ones means that in case of collision user’s wgetrc overrides the system-wide wgetrc (in /usr/local/etc/wgetrc by default). Fascist admins, away


6. 2 Wgetrc Syntax

The syntax of a wgetrc command is simple

The variable will also be called command. Valid values are different for different commands

The commands are case-, underscore- and minus-insensitive. Thus ‘DIr__PrefiX’, ‘DIr-PrefiX’ and ‘dirprefix’ are the same. Empty lines, lines beginning with ‘#’ and lines containing white-space only are discarded

Commands that expect a comma-separated list will clear the list on an empty command. So, if you wish to reset the rejection list specified in global wgetrc, you can do it with


6. 3 Wgetrc Commands

Bộ lệnh hoàn chỉnh được liệt kê bên dưới. Các giá trị pháp lý được liệt kê sau dấu '='. Các giá trị Boolean đơn giản có thể được đặt hoặc bỏ đặt bằng cách sử dụng 'bật' và 'tắt' hoặc '1' và '0'

Một số lệnh lấy giá trị giả tùy ý. giá trị địa chỉ có thể là tên máy chủ hoặc địa chỉ IP chấm tứ giác. n có thể là bất kỳ số nguyên dương nào hoặc 'inf' cho vô cực, nếu thích hợp. giá trị chuỗi có thể là bất kỳ chuỗi không trống nào

Hầu hết các lệnh này có tương đương dòng lệnh trực tiếp. Ngoài ra, bất kỳ lệnh wgetrc nào cũng có thể được chỉ định trên dòng lệnh bằng cách sử dụng khóa chuyển '--execute' (xem. )

chấp nhận/từ chối = chuỗi

Tương tự như ‘-A’/‘-R’ (xem )

add_hostdir = bật/tắt

Bật/tắt tên tệp có tiền tố máy chủ lưu trữ. '-nH' vô hiệu hóa nó

ask_password = on/off

Prompt for a password for each connection established. Cannot be specified when ‘--password’ is being used, because they are mutually exclusive. Equivalent to ‘--ask-password’

auth_no_challenge = bật/tắt

If this option is given, Wget will send Basic HTTP authentication information (plaintext username and password) for all requests. See ‘--auth-no-challenge’

background = on/off

Enable/disable going to background—the same as ‘-b’ (which enables it)

backup_converted = on/off

Enable/disable saving pre-converted files with the suffix ‘. orig’—the same as ‘-K’ (which enables it)

backups = number

Use up to number backups for a file. Backups are rotated by adding an incremental counter that starts at ‘1’. The default is ‘0’

base = string

Consider relative URLs in input files (specified via the ‘input’ command or the ‘--input-file’/‘-i’ option, together with ‘force_html’ or ‘--force-html’) as being relative to string—the same as ‘--base=string’

bind_address = address

Bind to address, like the ‘--bind-address=address’

ca_certificate = file

Set the certificate authority bundle file to file. The same as ‘--ca-certificate=file’

ca_directory = directory

Set the directory used for certificate authorities. The same as ‘--ca-directory=directory’

cache = on/off

When set to off, disallow server-caching. See the ‘--no-cache’ option

certificate = file

Set the client certificate file name to file. The same as ‘--certificate=file’

certificate_type = string

Specify the type of the client certificate, legal values being ‘PEM’ (the default) and ‘DER’ (aka ASN1). The same as ‘--certificate-type=string’

check_certificate = on/off

If this is set to off, the server certificate is not checked against the specified client authorities. The default is “on”. The same as ‘--check-certificate’

connect_timeout = n

Set the connect timeout—the same as ‘--connect-timeout’

content_disposition = on/off

Turn on recognition of the (non-standard) ‘Content-Disposition’ HTTP header—if set to ‘on’, the same as ‘--content-disposition’

trust_server_names = on/off

If set to on, construct the local file name from redirection URLs rather than original URLs

continue = on/off

If set to on, force continuation of preexistent partially retrieved files. See ‘-c’ before setting it

convert_links = on/off

Convert non-relative links locally. The same as ‘-k’

cookies = on/off

When set to off, disallow cookies. See the ‘--cookies’ option

cut_dirs = n

Ignore n remote directory components. Equivalent to ‘--cut-dirs=n’

debug = on/off

Debug mode, same as ‘-d’

default_page = string

Default page name—the same as ‘--default-page=string’

delete_after = on/off

Delete after download—the same as ‘--delete-after’

dir_prefix = string

Đầu cây thư mục—giống như '-P string'

điều hướng = bật/tắt

Bật hoặc tắt dirstruct—tương ứng với '-x' hoặc '-nd'

dns_cache = bật/tắt

Bật/tắt bộ nhớ đệm DNS. Since DNS caching is on by default, this option is normally used to turn it off and is equivalent to ‘--no-dns-cache’

dns_timeout = n

Đặt thời gian chờ DNS—giống như ‘--dns-timeout’

domains = string

Same as ‘-D’ (see )

dot_bytes = n

Specify the number of bytes “contained” in a dot, as seen throughout the retrieval (1024 by default). You can postfix the value with ‘k’ or ‘m’, representing kilobytes and megabytes, respectively. With dot settings you can tailor the dot retrieval to suit your needs, or you can use the predefined styles (see )

dot_spacing = n

Specify the number of dots in a single cluster (10 by default)

dots_in_line = n

Specify the number of dots that will be printed in each line throughout the retrieval (50 by default)

egd_file = file

Use string as the EGD socket file name. The same as ‘--egd-file=file’

exclude_directories = string

Specify a comma-separated list of directories you wish to exclude from download—the same as ‘-X string’ (see )

exclude_domains = string

Same as ‘--exclude-domains=string’ (see )

follow_ftp = on/off

Follow FTP links from HTML documents—the same as ‘--follow-ftp’

follow_tags = string

Only follow certain HTML tags when doing a recursive retrieval, just like ‘--follow-tags=string’

force_html = on/off

If set to on, force the input filename to be regarded as an HTML document—the same as ‘-F’

ftp_password = string

Set your FTP password to string. Without this setting, the password defaults to ‘-wget@’, which is a useful default for anonymous FTP access

This command used to be named

ftp://user:password@host/path
http://user:password@host/path
63 prior to Wget 1. 10

ftp_proxy = string

Use string as FTP proxy, instead of the one specified in environment

ftp_user = string

Set FTP user to string

This command used to be named

ftp://user:password@host/path
http://user:password@host/path
64 prior to Wget 1. 10

glob = on/off

Turn globbing on/off—the same as ‘--glob’ and ‘--no-glob’

header = string

Define a header for HTTP downloads, like using ‘--header=string’

compression = string

Choose the compression type to be used. Legal values are ‘auto’ (the default), ‘gzip’, and ‘none’. The same as ‘--compression=string’

adjust_extension = on/off

Add a ‘. html’ extension to ‘text/html’ or ‘application/xhtml+xml’ files that lack one, a ‘. css’ extension to ‘text/css’ files that lack one, and a ‘. br’, ‘. Z’, ‘. zlib’ or ‘. gz’ to compressed files like ‘-E’. Previously named ‘html_extension’ (still acceptable, but deprecated)

http_keep_alive = on/off

Turn the keep-alive feature on or off (defaults to on). Turning it off is equivalent to ‘--no-http-keep-alive’

http_password = string

Set HTTP password, equivalent to ‘--http-password=string’

http_proxy = string

Use string as HTTP proxy, instead of the one specified in environment

http_user = string

Đặt người dùng HTTP thành chuỗi, tương đương với '--http-user=string'

https_only = bật/tắt

When in recursive mode, only HTTPS links are followed (defaults to off)

https_proxy = chuỗi

Sử dụng chuỗi làm proxy HTTPS, thay vì chuỗi được chỉ định trong môi trường

ignore_case = on/off

Khi được đặt thành bật, khớp các tệp và thư mục một cách không nhạy cảm;

ignore_length = on/off

When set to on, ignore

ftp://user:password@host/path
http://user:password@host/path
65 header; the same as ‘--ignore-length’

ignore_tags = string

Ignore certain HTML tags when doing a recursive retrieval, like ‘--ignore-tags=string’

include_directories = string

Specify a comma-separated list of directories you wish to follow when downloading—the same as ‘-I string’

iri = on/off

When set to on, enable internationalized URI (IRI) support; the same as ‘--iri’

inet4_only = on/off

Force connecting to IPv4 addresses, off by default. You can put this in the global init file to disable Wget’s attempts to resolve and connect to IPv6 hosts. Available only if Wget was compiled with IPv6 support. The same as ‘--inet4-only’ or ‘-4’

inet6_only = on/off

Force connecting to IPv6 addresses, off by default. Available only if Wget was compiled with IPv6 support. The same as ‘--inet6-only’ or ‘-6’

input = file

Read the URLs from string, like ‘-i file’

keep_session_cookies = on/off

When specified, causes ‘save_cookies = on’ to also save session cookies. See ‘--keep-session-cookies’

limit_rate = rate

Limit the download speed to no more than rate bytes per second. The same as ‘--limit-rate=rate’

load_cookies = file

Load cookies from file. See ‘--load-cookies file’

local_encoding = encoding

Force Wget to use encoding as the default system encoding. See ‘--local-encoding’

logfile = file

Set logfile to file, the same as ‘-o file’

max_redirect = number

Specifies the maximum number of redirections to follow for a resource. See ‘--max-redirect=number’

mirror = on/off

Turn mirroring on/off. The same as ‘-m’

netrc = on/off

Turn reading netrc on or off

no_clobber = on/off

Same as ‘-nc’

no_parent = on/off

Disallow retrieving outside the directory hierarchy, like ‘--no-parent’ (see )

no_proxy = string

Use string as the comma-separated list of domains to avoid in proxy loading, instead of the one specified in environment

output_document = file

Set the output filename—the same as ‘-O file’

page_requisites = on/off

Download all ancillary documents necessary for a single HTML page to display properly—the same as ‘-p’

passive_ftp = on/off

Change setting of passive FTP, equivalent to the ‘--passive-ftp’ option

password = string

Specify password string for both FTP and HTTP file retrieval. This command can be overridden using the ‘ftp_password’ and ‘http_password’ command for FTP and HTTP respectively

post_data = string

Use POST as the method for all HTTP requests and send string in the request body. The same as ‘--post-data=string’

post_file = file

Use POST as the method for all HTTP requests and send the contents of file in the request body. The same as ‘--post-file=file’

prefer_family = none/IPv4/IPv6

When given a choice of several addresses, connect to the addresses with specified address family first. The address order returned by DNS is used without change by default. The same as ‘--prefer-family’, which see for a detailed discussion of why this is useful

private_key = file

Set the private key file to file. The same as ‘--private-key=file’

private_key_type = string

Specify the type of the private key, legal values being ‘PEM’ (the default) and ‘DER’ (aka ASN1). The same as ‘--private-type=string’

progress = string

Set the type of the progress indicator. Legal types are ‘dot’ and ‘bar’. Equivalent to ‘--progress=string’

protocol_directories = on/off

When set, use the protocol name as a directory component of local file names. The same as ‘--protocol-directories’

proxy_password = string

Đặt mật khẩu xác thực proxy thành chuỗi, như ‘--proxy-password=string’

proxy_user = string

Set proxy authentication user name to string, like ‘--proxy-user=string’

quiet = on/off

Chế độ im lặng—giống như '-q'

quota = quota

Specify the download quota, which is useful to put in the global wgetrc. When download quota is specified, Wget will stop retrieving after the download sum has become greater than quota. The quota can be specified in bytes (default), kbytes ‘k’ appended) or mbytes (‘m’ appended). Thus ‘quota = 5m’ will set the quota to 5 megabytes. Note that the user’s startup file overrides system settings

Random_file = tập tin

Sử dụng tệp làm nguồn ngẫu nhiên trên các hệ thống thiếu /dev/random

random_wait = on/off

Turn random between-request wait times on or off. The same as ‘--random-wait’

read_timeout = n

Set the read (and write) timeout—the same as ‘--read-timeout=n’

reclevel = n

Recursion level (depth)—the same as ‘-l n’

recursive = on/off

Recursive on/off—the same as ‘-r’

referer = string

Set HTTP ‘Referer. ’ header just like ‘--referer=string’. (Note that it was the folks who wrote the HTTP spec who got the spelling of “referrer” wrong. )

relative_only = on/off

Follow only relative links—the same as ‘-L’ (see )

remote_encoding = encoding

Force Wget to use encoding as the default remote server encoding. See ‘--remote-encoding’

remove_listing = on/off

If set to on, remove FTP listings downloaded by Wget. Setting it to off is the same as ‘--no-remove-listing’

restrict_file_names = unix/windows

Restrict the file names generated by Wget from URLs. See ‘--restrict-file-names’ for a more detailed description

retr_symlinks = on/off

When set to on, retrieve symbolic links as if they were plain files; the same as ‘--retr-symlinks’

retry_connrefused = on/off

When set to on, consider “connection refused” a transient error—the same as ‘--retry-connrefused’

robots = on/off

Specify whether the norobots convention is respected by Wget, “on” by default. This switch controls both the /robots. txt and the ‘nofollow’ aspect of the spec. See , for more details about this. Be sure you know what you are doing before turning this off

save_cookies = file

Save cookies to file. The same as ‘--save-cookies file’

save_headers = on/off

Same as ‘--save-headers’

safe_protocol = chuỗi

Choose the secure protocol to be used. Legal values are ‘auto’ (the default), ‘SSLv2’, ‘SSLv3’, and ‘TLSv1’. The same as ‘--secure-protocol=string’

server_response = on/off

Choose whether or not to print the HTTP and FTP server responses—the same as ‘-S’

show_all_dns_entries = on/off

When a DNS name is resolved, show all the IP addresses, not just the first three

span_hosts = on/off

Same as ‘-H’

spider = on/off

Same as ‘--spider’

strict_comments = on/off

Same as ‘--strict-comments’

timeout = n

Set all applicable timeout values to n, the same as ‘-T n’

timestamping = on/off

Turn timestamping on/off. The same as ‘-N’ (see )

use_server_timestamps = on/off

If set to ‘off’, Wget won’t set the local file’s timestamp by the one on the server (same as ‘--no-use-server-timestamps’)

tries = n

Set number of retries per URL—the same as ‘-t n’

use_proxy = on/off

When set to off, don’t use proxy even when proxy-related environment variables are set. In that case it is the same as using ‘--no-proxy’

user = string

Specify username string for both FTP and HTTP file retrieval. This command can be overridden using the ‘ftp_user’ and ‘http_user’ command for FTP and HTTP respectively

user_agent = string

User agent identification sent to the HTTP Server—the same as ‘--user-agent=string’

verbose = on/off

Turn verbose on/off—the same as ‘-v’/‘-nv’

wait = n

Wait n seconds between retrievals—the same as ‘-w n’

wait_retry = n

Wait up to n seconds between retries of failed retrievals only—the same as ‘--waitretry=n’. Note that this is turned on by default in the global wgetrc


6. 4 Sample Wgetrc

This is the sample initialization file, as given in the distribution. It is divided in two section—one for global usage (suitable for global startup file), and one for local usage (suitable for $HOME/. wgetrc). Be careful about the things you change

Note that almost all the lines are commented out. For a command to have any effect, you must remove the ‘#’ character at the beginning of its line

ftp://host/directory/file;type=a
3


7 Examples

The examples are divided into three sections loosely based on their complexity


7. 1 Simple Usage

  • Say you want to download a URL. Just type

    ftp://host/directory/file;type=a
    
    4

  • But what will happen if the connection is slow, and the file is lengthy? The connection will probably fail before the whole file is retrieved, more than once. In this case, Wget will try getting the file until it either gets the whole of it, or exceeds the default number of retries (this being 20). It is easy to change the number of tries to 45, to insure that the whole file will arrive safely

    ftp://host/directory/file;type=a
    
    5

  • Now let’s leave Wget to work in the background, and write its progress to log file log. It is tiring to type ‘--tries’, so we shall use ‘-t’

    ftp://host/directory/file;type=a
    
    6

    Dấu và ở cuối dòng đảm bảo rằng Wget hoạt động ở chế độ nền. To unlimit the number of retries, use ‘-t inf’

  • The usage of FTP is as simple. Wget will take care of login and password

    ftp://host/directory/file;type=a
    
    7

  • If you specify a directory, Wget will retrieve the directory listing, parse it and convert it to HTML. Try

    ftp://host/directory/file;type=a
    
    8


7. 2 Cách sử dụng nâng cao

  • Bạn có một tệp chứa các URL bạn muốn tải xuống?

    If you specify ‘-’ as file name, the URLs will be read from standard input

  • Create a five levels deep mirror image of the GNU web site, with the same directory structure the original has, with only one try per document, saving the log of the activities to gnulog

    ftp://host/directory/file;type=a
    
    9

  • The same as the above, but convert the links in the downloaded files to point to local files, so you can view the documents off-line

    wget -r --tries=10 http://fly.srk.fer.hr/ -o log
    
    0

  • Retrieve only one HTML page, but make sure that all the elements needed for the page to be displayed, such as inline images and external style sheets, are also downloaded. Also make sure the downloaded page references the downloaded links

    wget -r --tries=10 http://fly.srk.fer.hr/ -o log
    
    1

    The HTML page will be saved to www. example. com/dir/page. html, and the images, stylesheets, etc. , somewhere under www. example. com/, depending on where they were on the remote server

  • The same as the above, but without the www. example. com/ directory. In fact, I don’t want to have all those random server directories anyway—just save all those files under a download/ subdirectory of the current directory

    wget -r --tries=10 http://fly.srk.fer.hr/ -o log
    
    2

  • Retrieve the index. html of ‘www. lycos. com’, showing the original server headers

    wget -r --tries=10 http://fly.srk.fer.hr/ -o log
    
    3

  • Save the server headers with the file, perhaps for post-processing

    wget -r --tries=10 http://fly.srk.fer.hr/ -o log
    
    4

  • Retrieve the first two levels of ‘wuarchive. tiếng sáo. edu’, lưu chúng vào /tmp

    wget -r --tries=10 http://fly.srk.fer.hr/ -o log
    
    5

  • Bạn muốn tải xuống tất cả ảnh GIF từ một thư mục trên máy chủ HTTP. Bạn đã thử 'quên http. //www. thí dụ. com/dir/*. gif', nhưng điều đó không hoạt động vì truy xuất HTTP không hỗ trợ toàn cầu hóa. Trong trường hợp đó, sử dụng

    wget -r --tries=10 http://fly.srk.fer.hr/ -o log
    
    6

    Dài dòng hơn, nhưng hiệu quả là như nhau. ‘-r -l1’ có nghĩa là truy xuất đệ quy (xem ), với độ sâu tối đa là 1. '--no-parent' có nghĩa là các tham chiếu đến thư mục mẹ bị bỏ qua (xem) và '-A. gif’ có nghĩa là chỉ tải xuống các tệp GIF. ‘-A "*. gif"’ cũng sẽ hoạt động

  • Giả sử bạn đang tải xuống thì Wget bị gián đoạn. Bây giờ bạn không muốn ghi đè các tệp đã có. Nó sẽ là

    wget -r --tries=10 http://fly.srk.fer.hr/ -o log
    
    7

  • Nếu bạn muốn mã hóa tên người dùng và mật khẩu của mình thành HTTP hoặc FTP, hãy sử dụng cú pháp URL thích hợp (xem phần )

    wget -r --tries=10 http://fly.srk.fer.hr/ -o log
    
    8

    Tuy nhiên, xin lưu ý rằng việc sử dụng này không được khuyến khích trên các hệ thống nhiều người dùng vì nó tiết lộ mật khẩu của bạn cho bất kỳ ai nhìn vào đầu ra của

    wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
    
    2

  • Bạn muốn các tài liệu đầu ra chuyển sang đầu ra tiêu chuẩn thay vì tệp?

    wget -r --tries=10 http://fly.srk.fer.hr/ -o log
    
    9

    Bạn cũng có thể kết hợp hai tùy chọn và tạo đường dẫn để truy xuất tài liệu từ danh sách nóng từ xa

    wget -X '' -X /~nobody,/~somebody
    
    0


7. 3 Cách sử dụng rất nâng cao

  • Nếu bạn muốn Wget giữ bản sao của một trang (hoặc thư mục con FTP), hãy sử dụng ‘--mirror’ (‘-m’), đây là cách viết tắt của ‘-r -l inf -N’. Bạn có thể đặt Wget trong tệp crontab để yêu cầu nó kiểm tra lại trang web vào mỗi Chủ nhật

    wget -X '' -X /~nobody,/~somebody
    
    1

  • Ngoài những điều trên, bạn muốn các liên kết được chuyển đổi để xem cục bộ. Tuy nhiên, sau khi đọc hướng dẫn này, bạn biết rằng chuyển đổi liên kết không hoạt động tốt với dấu thời gian, vì vậy bạn cũng muốn Wget sao lưu các tệp HTML gốc trước khi chuyển đổi. Lời gọi wget sẽ như thế này

    wget -X '' -X /~nobody,/~somebody
    
    2

  • Nhưng bạn cũng nhận thấy rằng chế độ xem cục bộ không hoạt động tốt khi các tệp HTML được lưu dưới các phần mở rộng khác ngoài '. html’, có lẽ vì chúng được dùng làm chỉ mục. cgi. Vì vậy, bạn muốn Wget đổi tên tất cả các tệp được cung cấp với loại nội dung 'text/html' hoặc 'application/xhtml+xml' thành tên. html

    wget -X '' -X /~nobody,/~somebody
    
    3

    Hoặc, với ít gõ hơn

    wget -X '' -X /~nobody,/~somebody
    
    4


8 khác nhau

Chương này chứa tất cả những thứ không thể phù hợp với bất kỳ nơi nào khác


8. 1 proxy

Proxy là các máy chủ HTTP có mục đích đặc biệt được thiết kế để truyền dữ liệu từ máy chủ từ xa đến máy khách cục bộ. Một cách sử dụng điển hình của proxy là giảm tải mạng cho người dùng có kết nối chậm. Điều này đạt được bằng cách chuyển tất cả các yêu cầu HTTP và FTP thông qua proxy lưu trữ dữ liệu được truyền vào bộ đệm. Khi tài nguyên được lưu trong bộ đệm được yêu cầu lại, proxy sẽ trả về dữ liệu từ bộ đệm. Another use for proxies is for companies that separate (for security reasons) their internal networks from the rest of Internet. Để lấy thông tin từ Web, người dùng của họ kết nối và truy xuất dữ liệu từ xa bằng proxy được ủy quyền

Wget hỗ trợ proxy cho cả truy xuất HTTP và FTP. Cách tiêu chuẩn để chỉ định vị trí proxy mà Wget nhận ra là sử dụng các biến môi trường sau

ftp://user:password@host/path
http://user:password@host/path
67
ftp://user:password@host/path
http://user:password@host/path
68

Nếu được đặt, các biến

ftp://user:password@host/path
http://user:password@host/path
67 và
ftp://user:password@host/path
http://user:password@host/path
68 phải chứa URL của proxy cho các kết nối HTTP và HTTPS tương ứng

ftp://user:password@host/path
http://user:password@host/path
71

Biến này phải chứa URL của proxy cho các kết nối FTP. Điều khá phổ biến là

ftp://user:password@host/path
http://user:password@host/path
67 và
ftp://user:password@host/path
http://user:password@host/path
71 được đặt thành cùng một URL

ftp://user:password@host/path
http://user:password@host/path
74

Biến này phải chứa danh sách proxy phần mở rộng tên miền được phân tách bằng dấu phẩy và không được sử dụng cho. For instance, if the value of

ftp://user:password@host/path
http://user:password@host/path
74 is ‘. mit. edu’, proxy sẽ không được sử dụng để truy xuất tài liệu từ MIT

Ngoài các biến môi trường, vị trí và cài đặt proxy có thể được chỉ định từ bên trong chính Wget

‘--no-proxy’‘proxy = bật/tắt’

Tùy chọn này và lệnh tương ứng có thể được sử dụng để chặn việc sử dụng proxy, ngay cả khi các biến môi trường thích hợp được đặt

‘http_proxy = URL’‘https_proxy = URL’‘ftp_proxy = URL’‘no_proxy = string’

Các biến tệp khởi động này cho phép bạn ghi đè cài đặt proxy do môi trường chỉ định

Một số máy chủ proxy yêu cầu ủy quyền để cho phép bạn sử dụng chúng. Ủy quyền bao gồm tên người dùng và mật khẩu, phải được gửi bởi Wget. Như với ủy quyền HTTP, tồn tại một số sơ đồ xác thực. Đối với ủy quyền proxy, sơ đồ xác thực

ftp://user:password@host/path
http://user:password@host/path
76 hiện đang được triển khai

Bạn có thể chỉ định tên người dùng và mật khẩu của mình thông qua URL proxy hoặc thông qua các tùy chọn dòng lệnh. Giả sử rằng proxy của công ty được đặt tại 'proxy. Công ty. com’ tại cổng 8001, vị trí URL proxy chứa dữ liệu ủy quyền có thể trông như thế này

wget -X '' -X /~nobody,/~somebody
5

Ngoài ra, bạn có thể sử dụng các tùy chọn 'người dùng proxy' và 'mật khẩu proxy' và tương đương. cài đặt wgetrc

ftp://user:password@host/path
http://user:password@host/path
77 và
ftp://user:password@host/path
http://user:password@host/path
78 để đặt tên người dùng và mật khẩu proxy


8. 2 Distribution

Giống như tất cả các tiện ích GNU, phiên bản mới nhất của Wget có thể được tìm thấy tại trang lưu trữ GNU chính ftp. gnu. org, và gương của nó. Ví dụ, Wget 1. 21. 1-dirty có thể được tìm thấy tại https. // ftp. gnu. org/pub/gnu/wget/wget-1. 21. 1-bẩn. hắc ín. gz


8. 3 trang web

Trang web chính thức của GNU Wget có tại https//www. gnu. tổ chức/phần mềm/wget/. Tuy nhiên, thông tin hữu ích nhất nằm ở “The Wget Wgiki”, http. //quên. addictivecode. tổ chức/


8. 4 danh sách gửi thư

Danh sách chính

Danh sách gửi thư chính để thảo luận, báo cáo lỗi hoặc đặt câu hỏi về GNU Wget có tại bug-wget@gnu. tổ chức. Để đăng ký, hãy gửi email đến bug-wget-join@gnu. org hoặc truy cập https. // danh sách. gnu. org/mailman/listinfo/bug-wget

Bạn không cần đăng ký để gửi tin nhắn đến danh sách; . Nếu bạn muốn tin của mình hiện lên ngay lập tức, hãy đăng ký vào danh sách trước khi đăng. Lưu trữ cho danh sách có thể được tìm thấy tại https. // danh sách. gnu. org/archive/html/bug-wget/

Cổng NNTP/Usenettish cũng có sẵn qua Gmane. Bạn có thể xem kho lưu trữ Gmane tại http. //Tin tức. gmane. org/gmane. máy tính. trang web. quên đi. tổng quan. Lưu ý rằng kho lưu trữ Gmane thuận tiện bao gồm các tin nhắn từ cả danh sách hiện tại và danh sách trước đó. Tin nhắn cũng xuất hiện trong kho lưu trữ Gmane sớm hơn tại https. // danh sách. gnu. tổ chức

Danh sách lỗi thời

Trước đây, danh sách gửi thư wget@sunsite. dk đã được sử dụng làm danh sách thảo luận chính và một danh sách khác, wget-patches@sunsite. dk đã được sử dụng để gửi và thảo luận về các bản vá cho GNU Wget

Tin nhắn từ wget@sunsite. dk được lưu trữ tại

Tin nhắn từ wget-patches@sunsite. dk được lưu trữ tại


8. 5 Internet Relay Chat

In addition to the mailinglists, we also have a support channel set up via IRC at

ftp://user:password@host/path
http://user:password@host/path
79,
ftp://user:password@host/path
http://user:password@host/path
80. Hãy đến kiểm tra xem nó ra


8. 6 Lỗi báo cáo

Bạn có thể gửi báo cáo lỗi thông qua trình theo dõi lỗi GNU Wget (xem https. // thảo nguyên. gnu. org/bugs/?func=additem&group=wget) hoặc vào danh sách gửi thư của chúng tôi bug-wget@gnu. tổ chức

Truy cập https. // danh sách. gnu. org/mailman/listinfo/bug-wget để biết thêm thông tin (cách đăng ký, liệt kê tài liệu lưu trữ,. )

Trước khi thực sự gửi báo cáo lỗi, vui lòng thử làm theo một số nguyên tắc đơn giản

  1. Vui lòng cố gắng xác định rằng hành vi bạn thấy thực sự là một lỗi. Nếu Wget gặp sự cố, đó là một lỗi. Nếu Wget không hoạt động như tài liệu, thì đó là một lỗi. Nếu mọi thứ hoạt động kỳ lạ, nhưng bạn không chắc về cách thức hoạt động của chúng, thì đó có thể là một lỗi, nhưng bạn có thể muốn kiểm tra lại tài liệu và danh sách gửi thư (xem phần )
  2. Cố gắng lặp lại lỗi trong những trường hợp đơn giản nhất có thể. e. g. nếu Wget gặp sự cố khi tải xuống ‘wget -rl0 -kKE -t5 --no-proxy http. //example. com -o /tmp/log’, you should try to see if the crash is repeatable, and if will occur with a simpler set of options. Bạn thậm chí có thể thử bắt đầu tải xuống tại trang xảy ra sự cố để xem liệu trang đó có gây ra sự cố không

    Ngoài ra, trong khi tôi có thể sẽ quan tâm để biết nội dung của bạn. wgetrc, chỉ cần đưa nó vào thông báo gỡ lỗi có lẽ là một ý tưởng tồi. Thay vào đó, trước tiên bạn nên thử xem lỗi có lặp lại với. wgetrc di chuyển ra khỏi con đường. Chỉ khi nó chỉ ra rằng. cài đặt wgetrc ảnh hưởng đến lỗi, gửi cho tôi các phần có liên quan của tệp

  3. Vui lòng bắt đầu Wget với tùy chọn '-d' và gửi cho chúng tôi kết quả đầu ra (hoặc các phần có liên quan của chúng). Nếu Wget được biên dịch mà không có hỗ trợ gỡ lỗi, hãy biên dịch lại nó—việc theo dõi lỗi sẽ dễ dàng hơn nhiều với hỗ trợ gỡ lỗi được bật

    Ghi chú. vui lòng đảm bảo xóa mọi thông tin có khả năng nhạy cảm khỏi nhật ký gỡ lỗi trước khi gửi đến địa chỉ lỗi.

    ftp://user:password@host/path
    http://user:password@host/path
    
    81 sẽ không cố gắng thu thập thông tin nhạy cảm, nhưng nhật ký sẽ chứa bản ghi khá đầy đủ về giao tiếp của Wget với máy chủ, có thể bao gồm mật khẩu và các mẩu dữ liệu đã tải xuống. Vì địa chỉ lỗi được lưu trữ công khai nên bạn có thể cho rằng tất cả các báo cáo lỗi đều hiển thị công khai

  4. Nếu Wget bị lỗi, hãy thử chạy nó trong trình gỡ lỗi, e. g.
    ftp://user:password@host/path
    http://user:password@host/path
    
    82 và gõ
    ftp://user:password@host/path
    http://user:password@host/path
    
    83 để lấy dấu lùi. Điều này có thể không hoạt động nếu quản trị viên hệ thống đã vô hiệu hóa các tệp cốt lõi, nhưng vẫn an toàn để thử

8. 7 Tính di động

Like all GNU software, Wget works on the GNU system. Tuy nhiên, vì nó sử dụng GNU Autoconf để xây dựng và định cấu hình, và hầu như tránh sử dụng các tính năng “đặc biệt” của bất kỳ Unix cụ thể nào, nên nó sẽ biên dịch (và hoạt động) trên tất cả các hương vị Unix phổ biến

Các phiên bản Wget khác nhau đã được biên dịch và thử nghiệm dưới nhiều loại hệ thống Unix, bao gồm GNU/Linux, Solaris, SunOS 4. x, Mac OS X, OSF (còn gọi là Digital Unix hoặc Tru64), Ultrix, *BSD, IRIX, AIX, v.v. Một số hệ thống đó không còn được sử dụng rộng rãi và có thể không hỗ trợ các phiên bản Wget gần đây. Nếu Wget không thể biên dịch trên hệ thống của bạn, chúng tôi muốn biết về nó

Nhờ những người đóng góp tốt bụng, phiên bản Wget này biên dịch và hoạt động trên nền tảng Microsoft Windows 32-bit. Nó đã được biên dịch thành công bằng MS Visual C++ 6. 0, Watcom, Borland C và trình biên dịch GCC. Đương nhiên, nó bị thiếu một số tính năng có sẵn trên Unix, nhưng nó sẽ hoạt động như một sự thay thế cho những người bị mắc kẹt với Windows. Lưu ý rằng các phần Wget dành riêng cho Windows không được đảm bảo sẽ được hỗ trợ trong tương lai, mặc dù điều này đã xảy ra trong thực tế trong nhiều năm nay. Tất cả các câu hỏi và vấn đề trong việc sử dụng Windows nên được báo cáo tới danh sách gửi thư của Wget tại wget@sunsite. dk nơi các tình nguyện viên duy trì các tính năng liên quan đến Windows có thể xem chúng

Hỗ trợ xây dựng trên MS-DOS thông qua DJGPP đã được đóng góp bởi Gisle Vanem; . // antinode. thông tin/dec/sw/wget. html


8. 8 tín hiệu

Vì mục đích của Wget là hoạt động nền, nên nó bắt tín hiệu gác máy (

ftp://user:password@host/path
http://user:password@host/path
84) và bỏ qua nó. Nếu đầu ra là đầu ra tiêu chuẩn, nó sẽ được chuyển hướng đến một tệp có tên wget-log. Otherwise,
ftp://user:password@host/path
http://user:password@host/path
84 is ignored. Điều này thuận tiện khi bạn muốn chuyển hướng đầu ra của Wget sau khi khởi động nó

wget -X '' -X /~nobody,/~somebody
6

Ngoài ra, Wget sẽ không can thiệp vào các tín hiệu theo bất kỳ cách nào. C-c,

ftp://user:password@host/path
http://user:password@host/path
86 và
ftp://user:password@host/path
http://user:password@host/path
87 nên giết nó như nhau


9 phụ lục

Chương này chứa một số tài liệu tham khảo mà tôi cho là hữu ích


9. 1 Robot loại trừ

Rất dễ làm cho Wget lang thang không mục đích quanh một trang web, hút tất cả dữ liệu có sẵn đang được xử lý. 'wget -r site' và bạn đã thiết lập. Tuyệt vời?

Miễn là Wget chỉ truy xuất các trang tĩnh và thực hiện việc đó với tốc độ hợp lý (xem tùy chọn '--wait'), sẽ không có nhiều vấn đề. Vấn đề là Wget không thể phân biệt được sự khác biệt giữa trang tĩnh nhỏ nhất và CGI đòi hỏi khắt khe nhất. Một trang web mà tôi biết có một phần được xử lý bởi tập lệnh CGI Perl giúp chuyển đổi tệp Thông tin thành HTML một cách nhanh chóng. Tập lệnh chậm, nhưng hoạt động đủ tốt để người dùng xem tệp Thông tin không thường xuyên. Tuy nhiên, khi tải xuống Wget đệ quy của ai đó tình cờ gặp trang chỉ mục liên kết đến tất cả các tệp Thông tin thông qua tập lệnh, hệ thống sẽ bị dừng lại mà không cung cấp bất kỳ thứ gì hữu ích cho người dùng (Nhiệm vụ chuyển đổi tệp Thông tin này có thể được thực hiện cục bộ và truy cập

Để tránh loại tai nạn này, cũng như để bảo vệ quyền riêng tư cho các tài liệu cần được bảo vệ khỏi rô-bốt hoạt động tốt, khái niệm loại trừ rô-bốt đã được phát minh. Ý tưởng là quản trị viên máy chủ và tác giả tài liệu có thể chỉ định phần nào của trang web mà họ muốn bảo vệ khỏi rô-bốt và phần nào họ sẽ cho phép truy cập

The most popular mechanism, and the de facto standard supported by all the major robots, is the “Robots Exclusion Standard” (RES) written by Martijn Koster et al. năm 1994. Nó chỉ định định dạng của tệp văn bản chứa các lệnh hướng dẫn rô-bốt nên tránh các đường dẫn URL nào. Để được tìm thấy bởi robot, thông số kỹ thuật phải được đặt trong /robots. txt trong thư mục gốc của máy chủ mà các rô-bốt dự kiến ​​sẽ tải xuống và phân tích cú pháp

Mặc dù Wget không phải là rô bốt web theo nghĩa chặt chẽ nhất của từ này, nhưng nó có thể tải xuống phần lớn trang web mà không cần sự can thiệp của người dùng để tải xuống một trang riêng lẻ. Do đó, Wget vinh danh RES khi tải xuống đệ quy. Chẳng hạn, khi bạn phát hành

wget -X '' -X /~nobody,/~somebody
7

Đầu tiên, chỉ mục của 'www. thí dụ. com’ sẽ được tải xuống. Nếu Wget thấy rằng nó muốn tải thêm tài liệu từ máy chủ đó, nó sẽ yêu cầu ‘http. //www. thí dụ. com/robot. txt’ và nếu tìm thấy, hãy sử dụng nó để tải xuống thêm. người máy. txt chỉ được tải một lần trên mỗi máy chủ

Until version 1. 8, Wget hỗ trợ phiên bản đầu tiên của tiêu chuẩn, được viết bởi Martijn Koster vào năm 1994 và có sẵn tại http. //www. robottxt. tổ chức/gốc. html. Kể từ phiên bản 1. 8, Wget đã hỗ trợ các chỉ thị bổ sung được chỉ định trong bản thảo internet ‘’ có tiêu đề “Phương pháp kiểm soát rô-bốt web”. Bản nháp, theo như tôi biết là chưa bao giờ được tạo cho RFC, có sẵn tại http. //www. robottxt. org/norobots-rfc. txt

Sách hướng dẫn này không còn bao gồm văn bản của Tiêu chuẩn Loại trừ Robot

Cơ chế thứ hai, ít được biết đến hơn, cho phép tác giả của một tài liệu riêng lẻ chỉ định xem họ có muốn rô-bốt theo dõi các liên kết từ tệp hay không. Điều này đạt được bằng cách sử dụng thẻ

ftp://user:password@host/path
http://user:password@host/path
89, như thế này

wget -X '' -X /~nobody,/~somebody
8

Điều này được giải thích một số chi tiết tại http. //www. robottxt. org/meta. html. Wget hỗ trợ phương pháp loại trừ robot này ngoài /robots thông thường. loại trừ txt

Nếu bạn biết mình đang làm gì và thực sự muốn tắt tính năng loại trừ rô-bốt, hãy đặt biến

ftp://user:password@host/path
http://user:password@host/path
90 thành 'tắt' trong. wgetrc. Bạn có thể đạt được hiệu ứng tương tự từ dòng lệnh bằng cách sử dụng công tắc
ftp://user:password@host/path
http://user:password@host/path
91, e. g. ‘wget -e robot=tắt url. ’


9. 2 cân nhắc về bảo mật

Khi sử dụng Wget, bạn phải lưu ý rằng nó sẽ gửi mật khẩu không được mã hóa qua mạng, điều này có thể gây ra sự cố bảo mật. Dưới đây là những vấn đề chính và một số giải pháp

  1. Mật khẩu trên dòng lệnh được hiển thị bằng cách sử dụng
    wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
    
    2. Cách tốt nhất là sử dụng
    wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
    
    3 và cung cấp URL cho đầu vào tiêu chuẩn của Wget, mỗi URL nằm trên một dòng riêng biệt, được kết thúc bởi C-d. Một cách giải quyết khác là sử dụng. netrc để lưu mật khẩu;
  2. Sử dụng sơ đồ xác thực cơ bản không an toàn, mật khẩu không được mã hóa được truyền qua các bộ định tuyến và cổng mạng
  3. Mật khẩu FTP cũng không được mã hóa. Không có giải pháp tốt cho việc này vào lúc này
  4. Mặc dù đầu ra "bình thường" của Wget cố gắng ẩn mật khẩu, nhật ký gỡ lỗi hiển thị chúng, ở mọi dạng. Vấn đề này có thể tránh được bằng cách cẩn thận khi bạn gửi nhật ký gỡ lỗi (có, ngay cả khi bạn gửi chúng cho tôi)

9. 3 cộng tác viên

GNU Wget was written by Hrvoje Nikšić hniksic@xemacs. tổ chức,

Tuy nhiên, sự phát triển của Wget không bao giờ có thể tiến xa như hiện tại nếu không có sự giúp đỡ của nhiều người, với các báo cáo lỗi, đề xuất tính năng, bản vá hoặc thư nói rằng “Cảm ơn. ”

Xin gửi lời cảm ơn đặc biệt đến những người sau đây (không theo thứ tự cụ thể)

  • Dan Harkless—đã đóng góp rất nhiều mã và tài liệu có chất lượng cực cao, cũng như
    ftp://user:password@host/path
    http://user:password@host/path
    
    94 và các tùy chọn liên quan. Anh ấy là người bảo trì chính trong một thời gian và đã phát hành Wget 1. 6
  • Ian Abbott—đã đóng góp các bản sửa lỗi, các bản sửa lỗi liên quan đến Windows và cung cấp triển khai nguyên mẫu của bản tải xuống đệ quy đầu tiên trên diện rộng. Đồng duy trì Wget trong suốt 1. 8 chu kỳ phát hành
  • dấu chấm. nhóm tổ chức, đặc biệt là Karsten Thygesen—đã quyên góp các tài nguyên hệ thống như danh sách gửi thư, không gian web, không gian FTP và các kho kiểm soát phiên bản, cùng với rất nhiều thời gian để làm cho chúng thực sự hoạt động. Christian Reiniger đã giúp đỡ vô giá trong việc thiết lập Subversion
  • Heiko Herold—đã cung cấp các bản dựng Windows chất lượng cao và đóng góp báo cáo lỗi cũng như bản dựng trong nhiều năm
  • Shawn McHorse—báo cáo lỗi và vá lỗi
  • Kaveh R. Ghazi—on-the-fly
    ftp://user:password@host/path
    http://user:password@host/path
    
    95-ization. Rất nhiều bản sửa lỗi về tính di động
  • Gordon Matzigkeit—. hỗ trợ mạng
  • Zlatko Čalušić, Tomislav Vujec và Dražen Kačar—đề xuất tính năng và thảo luận “triết học”
  • Darko Budor—cổng ban đầu cho Windows
  • Antonio Rosella—trợ giúp và gợi ý, cùng với bản dịch tiếng Ý ban đầu
  • Tomislav Petrović, Mario Mikočević—nhiều báo cáo lỗi và đề xuất
  • Françis Pinard—nhiều báo cáo và thảo luận về lỗi kỹ lưỡng
  • Karl Eichwalder—rất nhiều trợ giúp về quốc tế hóa, bố cục Makefile và nhiều thứ khác
  • Junio ​​Hamano—đã quyên góp hỗ trợ cho xác thực Opie và HTTP
    ftp://user:password@host/path
    http://user:password@host/path
    
    96
  • Mauro Tortonesi—hỗ trợ IPv6 được cải thiện, thêm hỗ trợ cho các hệ thống gia đình kép. Refactored and enhanced FTP IPv6 code. Duy trì GNU Wget từ 2004–2007
  • Christopher G. Lewis—bảo trì phiên bản Windows của GNU WGet
  • Gisle Vanem—nhiều bản vá và cải tiến hữu ích, đặc biệt là hỗ trợ cho Windows và MS-DOS
  • Ralf Wildenhues—đã đóng góp các bản vá để chuyển đổi Wget sang sử dụng Automake như một phần của quá trình xây dựng và sửa nhiều lỗi khác nhau
  • Steven Schubiger—Nhiều bản vá, sửa lỗi và cải tiến hữu ích. Đáng chú ý là việc chuyển đổi Wget để sử dụng các mô-đun quote và quoteargs của Gnulib, đồng thời bổ sung lời nhắc mật khẩu tại bảng điều khiển, thông qua mô-đun Gnulib getpasswd-gnu
  • Ted Mielczarek—đã quyên góp hỗ trợ cho CSS
  • Saint Xavier—Hỗ trợ cho IRI (RFC 3987)
  • Tim Rühsen—Rất nhiều bản vá hữu ích, đặc biệt là hỗ trợ fuzzing và Tích hợp liên tục. Bảo trì từ năm 2014
  • Darshit Shah—Nhiều bản vá hữu ích. Community support on various platforms. Maintainer since 2014
  • People who provided donations for development—including Brian Gough

The following people have provided patches, bug/build reports, useful suggestions, beta testing services, fan mail and all the other things that make maintenance so much fun

Tim Adam, Adrian Aichner, Martin Baehr, Dieter Baron, Roger Beeman, Dan Berger, T. Bharath, Christian Biere, Paul Bludov, Daniel Bodea, Mark Boyns, John Burden, Julien Buty, Wanderlei Cavassin, Gilles Cedoc, Tim Charron, Noel Cragg, Kristijan Čonkaš, John Daily, Andreas Damm, Ahmon Dancy, Andrew Davison, Bertrand Demiddelaer, Alexander Dergachev, Andrew Deryabin, Ulrich Drepper, Marc Duponcheel, Damir Džeko, Alan Eldridge, Hans-Andreas Engel, Aleksandar Erkalović, Andy Eskilsson, João Ferreira, Christian Fraenkel, David Fritz, Mike Frysinger, Charles C. Fu, FUJISHIMA Satsuki, Masashi Fujita, Howard Gayle, Marcel Gerrits, Lemble Gregory, Hans Grobler, Alain Guibert, Mathieu Guillaume, Aaron Hawley, Jochen Hein, Karl Heuer, Madhusudan Hosaagrahara, HIROSE Masaaki, Ulf Harnhammar, Gregor Hoffleit, Erik Magnus Hulthen, Richard Huveneers, Jonas Jensen, Larry Jones, Simon Josefsson, Mario Jurić, Hack Kampbjørn, Const Kaplinsky, Goran Kezunović, Igor Khristophorov, Robert Kleine, KOJIMA Haime, Fila Kolodny, Alexander Kourakos, Martin Kraemer, Sami Krank, Jay Krell, Σίμος Ξενιτέλλης (Simos KSenitellis), Christian Lackas, Hrvoje Lacko, Daniel S. Lewart, Nicolás Lichtmeier, Dave Love, Alexander V. Lukyanov, Thomas Lußnig, Andre Majorel, Aurelien Marchand, Matthew J. Mellon, Jordan Mendelson, Ted Mielczarek, Robert Millan, Lin Zhe Min, Jan Minar, Tim Mooney, Keith Moore, Adam D. Moss, Simon Munton, Charlie Negyesi, R. K. Owen, Jim Paris, Kenny Parnell, Leonid Petrov, Simone Piunno, Andrew Pollock, Steve Pothier, Jan Přikryl, Marin Purgar, Csaba Ráduly, Keith Refson, Bill Richardson, Tyler Riddle, Tobias Ringstrom, Jochen Roderburg, Juan José Rodríguez, Maciej W. Rozycki, Edward J. Sabol, Heinz Salzmann, Robert Schmidt, Nicolas Schodet, Benno Schulenberg, Andreas Schwab, Steven M. Schweda, Chris Seawood, Pranab Shenoy, Dennis Smit, Toomas Soome, Tage Stabell-Kulo, Philip Stadermann, Daniel Stenberg, Sven Sternberger, Markus Strasser, John Summerfield, Szakacsits Szabolcs, Mike Thomas, Philipp Thomas, Mauro Tortonesi, Dave Turner, Gisle . Wegscheid, Ralf Wildenhues, Joshua David Williams, Benjamin Wolsey, Saint Xavier, YAMAZAKI Makoto, Jasmin Zainul, Bojan Ždrnja, Kristijan Zimmer, Xin Zou

Xin lỗi tất cả những người mà tôi đã vô tình bỏ qua và rất cảm ơn tất cả những người đăng ký danh sách gửi thư của Wget


Phụ lục A Sao chép hướng dẫn này


A. 1 Giấy phép Tài liệu Miễn phí GNU

Phiên bản 1. 3, 3 tháng 11 năm 2008

wget -X '' -X /~nobody,/~somebody
9

  1. LỜI MỞ ĐẦU

    Mục đích của Giấy phép này là làm cho sách hướng dẫn, sách giáo khoa hoặc tài liệu chức năng và hữu ích khác trở nên miễn phí theo nghĩa tự do. để đảm bảo cho mọi người quyền tự do hiệu quả để sao chép và phân phối lại nó, có hoặc không sửa đổi nó, vì mục đích thương mại hoặc phi thương mại. Thứ hai, Giấy phép này bảo vệ tác giả và nhà xuất bản một cách để nhận tín dụng cho tác phẩm của họ, trong khi không bị coi là chịu trách nhiệm đối với các sửa đổi do người khác thực hiện

    Giấy phép này là một loại “copyleft”, có nghĩa là bản thân các sản phẩm phái sinh của tài liệu phải tự do theo nghĩa tương tự. Nó bổ sung cho Giấy phép Công cộng GNU, là giấy phép copyleft được thiết kế cho phần mềm tự do

    Chúng tôi đã thiết kế Giấy phép này để sử dụng nó cho hướng dẫn sử dụng phần mềm miễn phí, bởi vì phần mềm miễn phí cần tài liệu miễn phí. một chương trình miễn phí phải đi kèm với sách hướng dẫn cung cấp các quyền tự do giống như phần mềm. Nhưng Giấy phép này không giới hạn ở hướng dẫn sử dụng phần mềm; . Chúng tôi khuyên dùng Giấy phép này chủ yếu cho các tác phẩm có mục đích hướng dẫn hoặc tham khảo

  2. KHẢ NĂNG ỨNG DỤNG VÀ ĐỊNH NGHĨA

    Giấy phép này áp dụng cho bất kỳ thủ công hoặc tác phẩm nào khác, trong bất kỳ phương tiện nào, có chứa thông báo do người giữ bản quyền đặt cho biết rằng nó có thể được phân phối theo các điều khoản của Giấy phép này. Thông báo như vậy cấp giấy phép toàn cầu, miễn phí bản quyền, không giới hạn thời hạn, để sử dụng tác phẩm đó theo các điều kiện được nêu ở đây. “Tài liệu” bên dưới đề cập đến bất kỳ sổ tay hoặc công việc nào như vậy. Bất kỳ thành viên nào của công chúng đều là người được cấp phép và được gọi là “bạn”. Bạn chấp nhận giấy phép nếu bạn sao chép, sửa đổi hoặc phân phối tác phẩm theo cách cần có sự cho phép theo luật bản quyền

    “Phiên bản đã sửa đổi” của Tài liệu có nghĩa là bất kỳ tác phẩm nào chứa Tài liệu hoặc một phần của nó, được sao chép nguyên văn hoặc có sửa đổi và/hoặc được dịch sang ngôn ngữ khác

    “Phần phụ” là một phụ lục được đặt tên hoặc một phần quan trọng nhất của Tài liệu chỉ liên quan đến mối quan hệ của nhà xuất bản hoặc tác giả của Tài liệu với chủ đề chung của Tài liệu (hoặc các vấn đề liên quan) và không chứa nội dung nào có thể ảnh hưởng trực tiếp đến . (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics. ) Mối quan hệ có thể là vấn đề liên quan đến lịch sử với chủ đề hoặc với các vấn đề liên quan, hoặc vị trí pháp lý, thương mại, triết học, đạo đức hoặc chính trị liên quan đến chúng

    “Phần bất biến” là một số Phần phụ nhất định có tiêu đề được chỉ định, giống như tiêu đề của Phần bất biến, trong thông báo nói rằng Tài liệu được phát hành theo Giấy phép này. Nếu một phần không phù hợp với định nghĩa ở trên về Thứ yếu thì nó không được phép chỉ định là Bất biến. Tài liệu có thể chứa 0 Phần bất biến. Nếu Tài liệu không xác định bất kỳ Phần bất biến nào thì không có phần nào

    “Văn bản bìa” là những đoạn văn bản ngắn nhất định được liệt kê, dưới dạng Văn bản bìa trước hoặc Văn bản bìa sau, trong thông báo nói rằng Tài liệu được phát hành theo Giấy phép này. Văn bản Bìa trước có thể có nhiều nhất là 5 từ và Văn bản Bìa sau có thể có nhiều nhất là 25 từ

    Bản sao "Trong suốt" của Tài liệu có nghĩa là bản sao có thể đọc được bằng máy, được thể hiện ở định dạng có thông số kỹ thuật sẵn có cho công chúng, phù hợp để sửa đổi tài liệu một cách trực tiếp bằng trình soạn thảo văn bản chung hoặc (đối với hình ảnh bao gồm pixel) sơn chung . Một bản sao được tạo ở định dạng tệp Minh bạch khác, có đánh dấu hoặc không có đánh dấu, đã được sắp xếp để ngăn cản hoặc không khuyến khích người đọc sửa đổi sau đó không phải là Minh bạch. Định dạng hình ảnh không trong suốt nếu được sử dụng cho bất kỳ lượng văn bản đáng kể nào. Bản sao không “Trong suốt” được gọi là “Đục”

    Ví dụ về các định dạng phù hợp cho Bản sao trong suốt bao gồm ASCII đơn giản không có đánh dấu, định dạng đầu vào Texinfo, định dạng đầu vào LaTeX, SGML hoặc XML bằng cách sử dụng DTD có sẵn công khai và HTML, PostScript hoặc PDF đơn giản phù hợp với tiêu chuẩn được thiết kế để con người sửa đổi. Ví dụ về các định dạng hình ảnh trong suốt bao gồm PNG, XCF và JPG. Các định dạng mờ bao gồm các định dạng độc quyền chỉ có thể được đọc và chỉnh sửa bởi các trình xử lý văn bản độc quyền, SGML hoặc XML mà DTD và/hoặc các công cụ xử lý thường không có sẵn và HTML, PostScript hoặc PDF do máy tạo ra bởi một số trình xử lý văn bản cho

    “Trang tiêu đề” có nghĩa là, đối với một cuốn sách in, chính trang tiêu đề đó, cộng với các trang tiếp theo cần thiết để giữ một cách rõ ràng, tài liệu mà Giấy phép này yêu cầu xuất hiện trong trang tiêu đề. Đối với các tác phẩm ở định dạng không có bất kỳ trang tiêu đề nào như vậy, “Trang tiêu đề” có nghĩa là văn bản gần phần nổi bật nhất của tiêu đề tác phẩm, trước phần đầu của phần nội dung văn bản

    “Nhà xuất bản” có nghĩa là bất kỳ cá nhân hoặc tổ chức nào phân phối các bản sao của Tài liệu cho công chúng

    Phần “Có tiêu đề XYZ” có nghĩa là đơn vị con được đặt tên của Tài liệu có tiêu đề chính xác là XYZ hoặc chứa XYZ trong ngoặc đơn theo sau văn bản dịch XYZ sang ngôn ngữ khác. (Ở đây XYZ là viết tắt của tên phần cụ thể được đề cập bên dưới, chẳng hạn như “Lời cảm ơn”, “Sự cống hiến”, “Sự xác nhận” hoặc “Lịch sử”. ) Để “Giữ Tiêu đề” của phần như vậy khi bạn sửa đổi Tài liệu có nghĩa là nó vẫn là phần “Có tiêu đề XYZ” theo định nghĩa này

    Tài liệu có thể bao gồm Tuyên bố miễn trừ trách nhiệm bảo hành bên cạnh thông báo nêu rõ rằng Giấy phép này áp dụng cho Tài liệu. Những tuyên bố miễn trừ trách nhiệm bảo hành này được coi là được đưa vào bằng cách tham chiếu trong Giấy phép này, nhưng chỉ liên quan đến các tuyên bố từ chối trách nhiệm. bất kỳ ngụ ý nào khác mà các Tuyên bố từ chối trách nhiệm bảo hành này có thể có đều vô hiệu và không ảnh hưởng đến ý nghĩa của Giấy phép này

  3. SAO CHÉP NGUYÊN BẢN

    Bạn có thể sao chép và phân phối Tài liệu bằng bất kỳ phương tiện nào, thương mại hoặc phi thương mại, với điều kiện là Giấy phép này, thông báo bản quyền và thông báo cấp phép cho biết Giấy phép này áp dụng cho Tài liệu được sao chép thành tất cả các bản sao và bạn không thêm bất kỳ điều kiện nào khác . Bạn không được sử dụng các biện pháp kỹ thuật để cản trở hoặc kiểm soát việc đọc hoặc sao chép thêm các bản sao bạn tạo hoặc phân phối. Tuy nhiên, bạn có thể chấp nhận bồi thường để trao đổi với các bản sao. Nếu phát hành số lượng đủ lớn cũng phải tuân theo các điều kiện ở mục 3

    Bạn cũng có thể cho mượn các bản sao, với cùng các điều kiện nêu trên, và bạn có thể trưng bày công khai các bản sao

  4. COPYING IN QUANTITY

    Nếu bạn xuất bản các bản in (hoặc các bản sao trên phương tiện thường có bìa in) của Tài liệu, đánh số hơn 100 và thông báo cấp phép của Tài liệu yêu cầu Văn bản bìa, thì bạn phải gửi kèm các bản sao trong bìa có tất cả những nội dung này một cách rõ ràng và dễ đọc. . Văn bản bìa trước ở bìa trước và Văn bản bìa sau ở bìa sau. Cả hai trang bìa cũng phải xác định rõ ràng và hợp pháp bạn là nhà xuất bản của những bản sao này. Bìa trước phải trình bày tiêu đề đầy đủ với tất cả các từ của tiêu đề nổi bật và dễ nhìn như nhau. Bạn có thể thêm các tài liệu khác trên bìa ngoài. Sao chép với các thay đổi giới hạn ở bìa, miễn là chúng giữ nguyên tiêu đề của Tài liệu và đáp ứng các điều kiện này, có thể được coi là sao chép nguyên văn ở các khía cạnh khác

    Nếu các văn bản cần thiết cho một trong hai trang bìa quá dày để có thể đọc được rõ ràng, bạn nên đặt những văn bản đầu tiên được liệt kê (nhiều nhất có thể) trên trang bìa thực tế và tiếp tục phần còn lại trên các trang liền kề

    Nếu bạn xuất bản hoặc phân phối các bản sao Không minh bạch của Tài liệu được đánh số hơn 100, bạn phải bao gồm một bản sao Trong suốt có thể đọc được bằng máy cùng với mỗi bản sao Không rõ ràng hoặc nêu rõ trong hoặc cùng với mỗi bản sao Không rõ ràng một vị trí mạng máy tính mà từ đó mạng chung- . Nếu bạn sử dụng tùy chọn thứ hai, bạn phải thực hiện các bước thận trọng hợp lý, khi bạn bắt đầu phân phối các bản sao Không trong suốt với số lượng lớn, để đảm bảo rằng bản sao Trong suốt này sẽ vẫn có thể truy cập được tại địa điểm đã nêu cho đến ít nhất một năm sau lần cuối cùng bạn phân phối một

    Bạn được yêu cầu, nhưng không bắt buộc, liên hệ kỹ với các tác giả của Tài liệu trước khi phân phối lại bất kỳ số lượng lớn bản sao nào, để họ có cơ hội cung cấp cho bạn phiên bản cập nhật của Tài liệu

  5. SỬA ĐỔI

    Bạn có thể sao chép và phân phối Phiên bản đã sửa đổi của Tài liệu theo các điều kiện của phần 2 và 3 ở trên, miễn là bạn phát hành Phiên bản đã sửa đổi theo đúng Giấy phép này, với Phiên bản đã sửa đổi đóng vai trò của Tài liệu, do đó cấp phép phân phối và sửa đổi . Ngoài ra, bạn phải làm những điều này trong Phiên bản sửa đổi

    1. Sử dụng trong Trang Tiêu đề (và trên trang bìa, nếu có) một tiêu đề khác biệt với tiêu đề của Tài liệu và với các phiên bản trước đó (nếu có, tiêu đề này phải được liệt kê trong phần Lịch sử của Tài liệu). Bạn có thể sử dụng tên giống như phiên bản trước nếu nhà xuất bản ban đầu của phiên bản đó cho phép
    2. Liệt kê trên Trang tiêu đề, với tư cách là tác giả, một hoặc nhiều người hoặc tổ chức chịu trách nhiệm về quyền tác giả đối với các sửa đổi trong Phiên bản đã sửa đổi, cùng với ít nhất năm tác giả chính của Tài liệu (tất cả các tác giả chính của nó, nếu nó có ít hơn
    3. Nêu trên trang Tiêu đề tên của nhà xuất bản Phiên bản đã sửa đổi, với tư cách là nhà xuất bản
    4. Preserve all the copyright notices of the Document
    5. Thêm một thông báo bản quyền thích hợp cho các sửa đổi của bạn bên cạnh các thông báo bản quyền khác
    6. Bao gồm, ngay sau thông báo bản quyền, thông báo giấy phép cho phép công chúng sử dụng Phiên bản đã sửa đổi theo các điều khoản của Giấy phép này, theo mẫu được hiển thị trong Phụ lục bên dưới
    7. Lưu giữ trong thông báo giấy phép đó danh sách đầy đủ các Phần bất biến và Văn bản bìa bắt buộc được cung cấp trong thông báo giấy phép của Tài liệu
    8. Bao gồm một bản sao không thay đổi của Giấy phép này
    9. Giữ nguyên phần Có tiêu đề “Lịch sử”, giữ nguyên Tiêu đề của nó và thêm vào đó một mục nêu ít nhất tiêu đề, năm, tác giả mới và nhà xuất bản của Phiên bản đã sửa đổi như được đưa ra trên Trang tiêu đề. Nếu không có phần Có tiêu đề “Lịch sử” trong Tài liệu, hãy tạo một mục nêu rõ tiêu đề, năm, tác giả và nhà xuất bản của Tài liệu như được cung cấp trên Trang tiêu đề, sau đó thêm một mục mô tả Phiên bản đã sửa đổi như đã nêu trong câu trước
    10. Giữ nguyên vị trí mạng, nếu có, được cung cấp trong Tài liệu để truy cập công khai vào bản sao Minh bạch của Tài liệu và tương tự như vậy, các vị trí mạng được cung cấp trong Tài liệu cho các phiên bản trước mà nó dựa trên. Chúng có thể được đặt trong phần "Lịch sử". Bạn có thể bỏ qua vị trí mạng đối với một tác phẩm đã được xuất bản trước Tài liệu ít nhất bốn năm hoặc nếu nhà xuất bản ban đầu của phiên bản mà nó đề cập cho phép
    11. Đối với bất kỳ phần nào có tiêu đề “Lời cảm ơn” hoặc “Cống hiến”, Giữ nguyên Tiêu đề của phần đó và giữ nguyên trong phần này tất cả nội dung và giọng điệu của từng lời cảm ơn và/hoặc cống hiến của người đóng góp được đưa ra trong đó
    12. Giữ nguyên tất cả các Phần bất biến của Tài liệu, không thay đổi nội dung và tiêu đề của chúng. Số phần hoặc tương đương không được coi là một phần của tiêu đề phần
    13. Xóa bất kỳ phần nào có tiêu đề “Chứng thực”. Một phần như vậy có thể không được bao gồm trong Phiên bản sửa đổi
    14. Không đặt lại tiêu đề cho bất kỳ phần hiện có nào thành Có tiêu đề là “Chứng thực” hoặc xung đột về tiêu đề với bất kỳ Phần bất biến nào
    15. Giữ nguyên mọi Tuyên bố miễn trừ trách nhiệm bảo hành

    Nếu Phiên bản đã sửa đổi bao gồm các phần quan trọng nhất hoặc các phụ lục đủ điều kiện là Phần phụ và không chứa tài liệu được sao chép từ Tài liệu, bạn có thể tùy chọn chỉ định một số hoặc tất cả các phần này là bất biến. Để thực hiện việc này, hãy thêm tiêu đề của chúng vào danh sách Phần bất biến trong thông báo giấy phép của Phiên bản đã sửa đổi. Các tiêu đề này phải khác biệt với bất kỳ tiêu đề phần nào khác

    You may add a section Entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard

    Bạn có thể thêm một đoạn văn dài tối đa năm từ làm Văn bản Bìa trước và một đoạn văn tối đa 25 từ làm Văn bản Bìa sau, vào cuối danh sách Văn bản Bìa trong Phiên bản đã Sửa đổi. Chỉ một đoạn Văn bản Bìa trước và một đoạn Văn bản Bìa sau có thể được thêm vào bởi (hoặc thông qua sự sắp xếp của) bất kỳ thực thể nào. Nếu Tài liệu đã bao gồm một văn bản trang bìa cho cùng một trang bìa, do bạn thêm trước đó hoặc theo thỏa thuận của cùng một thực thể mà bạn đang đại diện, thì bạn không thể thêm văn bản khác;

    (Các) tác giả và (các) nhà xuất bản của Tài liệu không theo Giấy phép này cho phép sử dụng tên của họ để công khai hoặc để khẳng định hoặc ngụ ý chứng thực bất kỳ Phiên bản đã sửa đổi nào

  6. TỔNG HỢP GIẤY TỜ

    Bạn có thể kết hợp Tài liệu với các tài liệu khác được phát hành theo Giấy phép này, theo các điều khoản được xác định trong phần 4 ở trên đối với các phiên bản đã sửa đổi, với điều kiện là bạn đưa vào phần kết hợp tất cả các Phần Bất biến của tất cả các tài liệu gốc, chưa sửa đổi và liệt kê tất cả chúng

    Công việc kết hợp chỉ cần chứa một bản sao của Giấy phép này và nhiều Phần bất biến giống hệt nhau có thể được thay thế bằng một bản sao duy nhất. Nếu có nhiều Phần bất biến có cùng tên nhưng nội dung khác nhau, hãy đặt tiêu đề của từng phần đó thành duy nhất bằng cách thêm vào cuối phần đó, trong ngoặc đơn, tên của tác giả gốc hoặc nhà xuất bản của phần đó nếu biết, hoặc nếu không thì thêm . Thực hiện điều chỉnh tương tự đối với tiêu đề phần trong danh sách Phần bất biến trong thông báo giấy phép của tác phẩm kết hợp

    Trong sự kết hợp, bạn phải kết hợp bất kỳ phần nào có tiêu đề “Lịch sử” trong các tài liệu gốc khác nhau, tạo thành một phần có tiêu đề “Lịch sử”; . Bạn phải xóa tất cả các phần có tiêu đề “Chứng thực. ”

  7. SƯU TẦM TÀI LIỆU

    Bạn có thể tạo một bộ sưu tập bao gồm Tài liệu và các tài liệu khác được phát hành theo Giấy phép này và thay thế các bản sao riêng lẻ của Giấy phép này trong các tài liệu khác nhau bằng một bản sao duy nhất được bao gồm trong bộ sưu tập, miễn là bạn tuân theo các quy tắc của Giấy phép này để

    Bạn có thể trích xuất một tài liệu từ bộ sưu tập như vậy và phân phối riêng lẻ theo Giấy phép này, miễn là bạn chèn một bản sao của Giấy phép này vào tài liệu được trích xuất và tuân theo Giấy phép này trong tất cả các khía cạnh khác liên quan đến việc sao chép nguyên văn tài liệu đó

  8. TỔNG HỢP VỚI TÁC PHẨM ĐỘC LẬP

    Việc biên soạn Tài liệu hoặc các sản phẩm phái sinh của nó cùng với các tài liệu hoặc tác phẩm riêng biệt và độc lập khác, trong hoặc trên một khối lượng phương tiện lưu trữ hoặc phân phối, được gọi là “tổng hợp” nếu bản quyền phát sinh từ việc biên soạn không được sử dụng để hạn chế các quyền hợp pháp . Khi Tài liệu được bao gồm trong một tập hợp, Giấy phép này không áp dụng cho các tác phẩm khác trong tập hợp không phải là tác phẩm phái sinh của Tài liệu

    Nếu yêu cầu về Văn bản bìa của phần 3 được áp dụng cho các bản sao này của Tài liệu, thì nếu Tài liệu ít hơn một nửa tổng số, thì Văn bản bìa của Tài liệu có thể được đặt trên các trang bìa bao quanh Tài liệu trong tổng số, hoặc . Nếu không, chúng phải xuất hiện trên bìa in bao quanh toàn bộ tổng hợp

  9. DỊCH

    Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Việc thay thế các Phần không thay đổi bằng các bản dịch cần có sự cho phép đặc biệt từ chủ sở hữu bản quyền của họ, nhưng bạn có thể bao gồm các bản dịch của một số hoặc tất cả các Phần không thay đổi ngoài các phiên bản gốc của các Phần không thay đổi này. Bạn có thể đính kèm bản dịch của Giấy phép này và tất cả các thông báo về giấy phép trong Tài liệu cũng như bất kỳ Tuyên bố miễn trừ trách nhiệm bảo hành nào, với điều kiện là bạn cũng bao gồm phiên bản gốc tiếng Anh của Giấy phép này và các phiên bản gốc của những thông báo và tuyên bố từ chối trách nhiệm đó. Trong trường hợp có sự bất đồng giữa bản dịch và bản gốc của Giấy phép này hoặc có thông báo hoặc tuyên bố từ chối trách nhiệm, bản gốc sẽ được ưu tiên áp dụng

    Nếu một phần trong Tài liệu có Tiêu đề là “Lời cảm ơn”, “Cống hiến” hoặc “Lịch sử”, thì yêu cầu (phần 4) để Giữ nguyên Tiêu đề của nó (phần 1) thường sẽ yêu cầu thay đổi tiêu đề thực tế

  10. CHẤM DỨT

    Bạn không được sao chép, sửa đổi, cấp phép lại hoặc phân phối Tài liệu trừ khi được cung cấp rõ ràng theo Giấy phép này. Bất kỳ nỗ lực nào khác để sao chép, sửa đổi, cấp phép lại hoặc phân phối nó đều vô hiệu và sẽ tự động chấm dứt các quyền của bạn theo Giấy phép này

    Tuy nhiên, nếu bạn chấm dứt mọi hành vi vi phạm Giấy phép này, thì giấy phép của bạn từ một chủ sở hữu bản quyền cụ thể sẽ được khôi phục (a) tạm thời, trừ khi và cho đến khi chủ sở hữu bản quyền chấm dứt giấy phép của bạn một cách rõ ràng và cuối cùng, và (b) vĩnh viễn, nếu chủ sở hữu bản quyền không thành công

    Ngoài ra, giấy phép của bạn từ một chủ sở hữu bản quyền cụ thể sẽ được khôi phục vĩnh viễn nếu chủ sở hữu bản quyền thông báo cho bạn về vi phạm bằng một số phương tiện hợp lý, đây là lần đầu tiên bạn nhận được thông báo vi phạm Giấy phép này (đối với bất kỳ tác phẩm nào) từ chủ sở hữu bản quyền đó,

    Việc chấm dứt quyền của bạn theo phần này không chấm dứt giấy phép của các bên đã nhận bản sao hoặc quyền từ bạn theo Giấy phép này. Nếu các quyền của bạn đã bị chấm dứt và không được khôi phục vĩnh viễn, thì việc nhận một bản sao của một số hoặc tất cả cùng một tài liệu sẽ không cấp cho bạn bất kỳ quyền nào để sử dụng tài liệu đó

  11. CÁC SỬA ĐỔI TRONG TƯƠNG LAI CỦA GIẤY PHÉP NÀY

    The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Các phiên bản mới như vậy sẽ tương tự về mặt tinh thần với phiên bản hiện tại, nhưng có thể khác về chi tiết để giải quyết các vấn đề hoặc mối quan tâm mới. xem http. //www. gnu. tổ chức/copyleft/

    Mỗi phiên bản của Giấy phép được cung cấp một số phiên bản phân biệt. Nếu Tài liệu chỉ định rằng một phiên bản được đánh số cụ thể của Giấy phép này “hoặc bất kỳ phiên bản nào mới hơn” áp dụng cho nó, thì bạn có tùy chọn tuân theo các điều khoản và điều kiện của phiên bản được chỉ định đó hoặc của bất kỳ phiên bản nào sau này đã được xuất bản (không phải là . Nếu Tài liệu không chỉ định số phiên bản của Giấy phép này, bạn có thể chọn bất kỳ phiên bản nào đã từng được Tổ chức Phần mềm Tự do xuất bản (không phải dưới dạng bản nháp). Nếu Tài liệu chỉ định rằng một người được ủy quyền có thể quyết định phiên bản nào trong tương lai của Giấy phép này có thể được sử dụng, thì tuyên bố công khai của người ủy quyền đó về việc chấp nhận một phiên bản sẽ cho phép bạn vĩnh viễn chọn phiên bản đó cho Tài liệu

  12. GIẤY PHÉP

    “Trang web hợp tác nhiều tác giả lớn” (hoặc “Trang web MMC”) có nghĩa là bất kỳ máy chủ World Wide Web nào xuất bản các tác phẩm có bản quyền và cũng cung cấp các phương tiện nổi bật để bất kỳ ai chỉnh sửa các tác phẩm đó. Một wiki công cộng mà bất kỳ ai cũng có thể chỉnh sửa là một ví dụ về một máy chủ như vậy. “Cộng tác nhiều tác giả lớn” (hoặc “MMC”) có trong trang web có nghĩa là bất kỳ bộ tác phẩm có bản quyền nào được xuất bản trên trang web MMC

    “CC-BY-SA” có nghĩa là Creative Commons Ghi công-Chia sẻ tương tự 3. 0 được phát hành bởi Creative Commons Corporation, một công ty phi lợi nhuận có trụ sở kinh doanh chính tại San Francisco, California, cũng như các phiên bản copyleft trong tương lai của giấy phép đó được phát hành bởi chính tổ chức đó

    “Kết hợp” có nghĩa là xuất bản hoặc xuất bản lại một Tài liệu, toàn bộ hoặc một phần, như một phần của Tài liệu khác

    Một MMC “đủ điều kiện để cấp phép lại” nếu nó được cấp phép theo Giấy phép này và nếu tất cả các tác phẩm được xuất bản lần đầu theo Giấy phép này ở một nơi nào đó ngoài MMC này và sau đó được tích hợp toàn bộ hoặc một phần vào MMC, (1) không có

    Người điều hành một Trang web MMC có thể xuất bản lại một MMC có trong trang web theo CC-BY-SA trên cùng một trang web vào bất kỳ thời điểm nào trước ngày 1 tháng 8 năm 2009, với điều kiện là MMC đủ điều kiện để tái cấp phép

PHỤ LỤC. Cách sử dụng Giấy phép này cho tài liệu của bạn

Để sử dụng Giấy phép này trong tài liệu bạn đã viết, hãy đưa một bản sao của Giấy phép vào tài liệu và đặt thông báo bản quyền và giấy phép sau đây ngay sau trang tiêu đề

wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
0

Nếu bạn có Phần bất biến, Văn bản bìa trước và Văn bản bìa sau, hãy thay thế “bằng…Văn bản. ” phù hợp với điều này

wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
1

Nếu bạn có Phần bất biến không có Văn bản bìa hoặc một số kết hợp khác của cả ba, hãy hợp nhất hai lựa chọn thay thế đó cho phù hợp với tình huống

Nếu tài liệu của bạn chứa các ví dụ không tầm thường về mã chương trình, chúng tôi khuyên bạn nên phát hành song song các ví dụ này theo lựa chọn giấy phép phần mềm tự do của bạn, chẳng hạn như Giấy phép Công cộng GNU, để cho phép sử dụng chúng trong phần mềm miễn phí