2.13 Exit Status

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.