LinuxmacOS

Where Does wget Store Config and HSTS Data?

Where wget reads .wgetrc startup settings and keeps the .wget-hsts host database in your home folder.

Last updated

Wget reads startup settings from ~/.wgetrc in your home directory (after the system /etc/wgetrc), and records HSTS host data in ~/.wget-hsts beside it. Both are plain text, one setting per line.

Downloads never touch either file: they land in the current directory unless -P or -O redirect them. When a familiar command behaves differently, the culprit is usually a forgotten line in .wgetrc or a stale HSTS entry, not the flags you just typed. The --no-config flag isolates scripts cleanly.

Where Wget stores this, by platform

Linux
~/.wgetrc

.wgetrc for defaults plus .wget-hsts for the STS database. Wget2 reads .wget2rc instead, which is the usual reason migrated settings stop working. Both files tolerate comments with # prefixes.

macOS
~/.wgetrc

Same dotfiles in $HOME for Homebrew and MacPorts builds. macOS ships curl, not wget, so the file appears only after installing wget yourself. Terminal and scripted runs share it.

Frequently asked questions

where is the wget config file

Create ~/.wgetrc with one setting per line (for example robots=off or progress=bar). Wget reads it at every launch plus /etc/wgetrc for system defaults, user file winning. Wget2 uses a different name, so check the version when settings ignore you.

what is the wget-hsts file

In ~/.wget-hsts, a plain text list of hosts with HSTS max age values. Delete entries (or the file) to retry a host whose certificate changed. Browsers keep their own HSTS separately, so this only affects wget fetches.

does wget store downloads in its config folder

No. Wget writes downloads to the current directory (or -P prefix, or -O filename) and reads settings from home. A missing file means the launch directory was wrong, not the config. The -o log file records the session separately.

Notice an outdated path? Let us know.