Exit Status (GNU Wget 1.21.1-dirty Manual)
2.13 Exit Status
Wget may return one of several error codes if it encounters problems.
- No problems occurred.
- Generic error code.
- Parse error—for instance, when parsing command-line options, the ‘
.wgetrc’ or ‘
- File I/O error.
- Network failure.
- SSL verification failure.
- Username/password authentication failure.
- Protocol errors.
- 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.