LINKCHECKER(1)
LINKCHECKER(1) π the LinkChecker manual, bestie edition
okay so. linkchecker is the LinkChecker command line client, and it lives in manual section 1, and it is literally about to change your whole link-checking life. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
linkchecker β command line client to check HTML documents and websites for broken links
like, it goes and finds the dead links for you so you don't have to click 4000 things at 2am. iconic behavior. π¦
πΈ SYNOPSIS πΈ
linkchecker [options] [file-or-url]...
that's it. that's the whole vibe. options, then one or more files or URLs, and she goes to work. β¨
π DESCRIPTION π
okay so here's what LinkChecker actually brings to the function. LinkChecker features:
- recursive and multithreaded checking π
- output in colored or normal text, HTML, SQL, CSV, XML or a sitemap graph in different formats π
- support for HTTP/1.1, HTTPS, FTP, mailto: and local file links π₯
- restriction of link checking with URL filters π
- proxy support π§
- username/password authorization for HTTP and FTP π
- support for robots.txt exclusion protocol β
- support for Cookies π
- support for HTML5 π
- Antivirus check π¦
- a command line and web interface πΈ
she does ALL of that. no cap. π
π EXAMPLES π
the most common use checks the given domain recursively:
$ linkchecker http://www.example.com/
β οΈ beware that this checks the whole site which can have thousands of URLs. use the -r option to restrict the recursion depth, bestie, or you will be waiting a while. π
don't check URLs with /secret in its name. all other links are checked as usual:
$ linkchecker --ignore-url=/secret mysite.example.com
checking a local HTML file on Unix:
$ linkchecker ../bla.html
checking a local HTML file on Windows:
C:\> linkchecker c:empest.html
you can skip the http:// url part if the domain starts with www.:
$ linkchecker www.example.com
you can skip the ftp:// url part if the domain starts with ftp.:
$ linkchecker -r0 ftp.example.com
generate a sitemap graph and convert it with the graphviz dot utility:
$ linkchecker -odot -v www.example.com | dot -Tps > sitemap.ps
see? ate. π
β¨ OPTIONS β¨
π· General options
-f FILENAME,--config=FILENAMEβ useFILENAMEas configuration file. by default LinkChecker uses$XDG_CONFIG_HOME/linkchecker/linkcheckerrc. π-h,--helpβ help me! print usage information for this program. (yes, she's asking for help. relatable.) π-t NUMBER,--threads=NUMBERβ generate no more than the given number of threads. default number of threads is10. to disable threading specify a non-positive number. π₯-V,--versionβ print version and exit. π--list-pluginsβ print available check plugins and exit. π
π Output options
π URL checking results
-F TYPE[/ENCODING][/FILENAME],--file-output=TYPE[/ENCODING][/FILENAME]β output to a filelinkchecker-out.TYPE,$XDG_DATA_HOME/linkchecker/failuresfor the failures output type, orFILENAMEif specified. theENCODINGspecifies the output encoding, the default is that of your locale. valid encodings are listed at https://docs.python.org/library/codecs.html#standard-encodings. theFILENAMEandENCODINGparts of thenoneoutput type will be ignored, else if the file already exists, it will be overwritten. you can specify this option more than once. valid file outputTYPEs aretext,html,sql,csv,gml,dot,xml,sitemap,noneorfailures. default is no file output. the various output types are documented below. note that you can suppress all console output with the option-o none. π--no-warningsβ don't log warnings. default is to log warnings. π«Ά-o TYPE[/ENCODING],--output=TYPE[/ENCODING]β specify the console output type astext,html,sql,csv,gml,dot,xml,sitemap,noneorfailures. default type istext. the various output types are documented below. theENCODINGspecifies the output encoding, the default is that of your locale. valid encodings are listed at https://docs.python.org/library/codecs.html#standard-encodings. πΈ-v,--verboseβ log all checked URLs, overriding--no-warnings. default is to log only errors and warnings. π₯
π¦ Progress updates
--no-statusβ do not print URL check status messages. (she goes quiet. mysterious. main character energy.)
β Application
-D STRING,--debug=STRINGβ print debugging output for the given logger. available debug loggers arecmdline,checking,cache,pluginandall.allis an alias for all available loggers. this option can be given multiple times to debug with more than one logger. π§
π Quiet
-q,--quietβ quiet operation, an alias for-o nonethat also hides application information messages. this is only useful with-F, else no results will be output. fr fr, read that last part again. π
π Checking options
--cookiefile=FILENAMEβ use initial cookie data read from a file. the cookie data format is explained below. π--check-externβ check external URLs. π--ignore-url=REGEXβ URLs matching the given regular expression will only be syntax checked. this option can be given multiple times. see section REGULAR EXPRESSIONS for more info. π--no-follow-url=REGEXβ check but do not recurse into URLs matching the given regular expression. this option can be given multiple times. see section REGULAR EXPRESSIONS for more info. π--no-robotsβ check URLs regardless of anyrobots.txtfiles. π«Ά-p,--passwordβ read a password from console and use it for HTTP and FTP authorization. for FTP the default password isanonymous@. for HTTP there is no default password. see also-u. π-r NUMBER,--recursion-level=NUMBERβ check recursively all links up to given depth. a negative depth will enable infinite recursion. default depth is infinite. (infinite!! the way that she just keeps going??) π--timeout=NUMBERβ set the timeout for connection attempts in seconds. the default timeout is60seconds. β³-u STRING,--user=STRINGβ try the given username for HTTP and FTP authorization. for FTP the default username isanonymous. for HTTP there is no default username. see also-p. π--user-agent=STRINGβ specify theUser-Agentstring to send to the HTTP server, for example"Mozilla/4.0". the default is"LinkChecker/X.Y"whereX.Yis the current version of LinkChecker. π¦
πΈ Input options
--stdinβ read from stdin a list of white-space separated URLs to check. πFILE-OR-URLβ the location to start checking with. a file can be a simple list of URLs, one per line, if the first line is"# LinkChecker URL list". π
π CONFIGURATION FILES π
configuration files can specify all options above. they can also specify some options that cannot be set on the command line. see linkcheckerrc(5) for more info. (yes bestie, there's a whole other manual page for the config file. she's thorough like that.) π§
π₯ OUTPUT TYPES π₯
β οΈ note that by default only errors and warnings are logged. you should use the option --verbose to get the complete URL list, especially when outputting a sitemap graph format. like, especially then. no cap.
textβ standard text logger, logging URLs in keyword: argument fashion. β¨htmlβ log URLs in keyword: argument fashion, formatted as HTML. additionally has links to the referenced pages. invalid URLs have HTML and CSS syntax check links appended. πcsvβ log check result in CSV format with one URL per line. πgmlβ log parent-child relations between linked URLs as a GML sitemap graph. π¦dotβ log parent-child relations between linked URLs as a DOT sitemap graph. πgxmlβ log check result as a GraphXML sitemap graph. πxmlβ log check result as machine-readable XML. βsitemapβ log check result as an XML sitemap whose protocol is documented at https://www.sitemaps.org/protocol.html. πsqlβ log check result as SQL script withINSERTcommands. an example script to create the initial SQL table is included ascreate.sql. πfailuresβ suitable for cron jobs. logs the check result into a file$XDG_DATA_HOME/linkchecker/failureswhich only contains entries with invalid URLs and the number of times they have failed. π₯noneβ logs nothing. suitable for debugging or checking the exit code. π
π§ REGULAR EXPRESSIONS π§
LinkChecker accepts Python regular expressions. see https://docs.python.org/howto/regex.html for an introduction. an addition is that a leading exclamation mark negates the regular expression. (so ! at the front = "not this one, bestie") π
π COOKIE FILES π
a cookie file contains standard HTTP header (RFC 2616) data with the following possible names:
Host(required) β sets the domain the cookies are valid for. πPath(optional) β gives the path the cookies are value for; default path is/. πΈSet-cookie(required) β set cookie name/value. can be given more than once. πͺ
multiple entries are separated by a blank line. the example below will send two cookies to all URLs starting with http://example.com/hello/ and one to all URLs starting with https://example.org/:
Host: example.com
Path: /hello
Set-cookie: ID="smee"
Set-cookie: spam="egg"
Host: example.org
Set-cookie: baggage="elitist"; comment="hologram"
look at her. sending cookies around like it's nothing. slay. π«Ά
π PROXY SUPPORT π
to use a proxy on Unix or Windows set the http_proxy or https_proxy environment variables to the proxy URL. the URL should be of the form http://[user:pass@]host[:port]. LinkChecker also detects manual proxy settings of Internet Explorer under Windows systems. on a Mac use the Internet Config to select a proxy. you can also set a comma-separated domain list in the no_proxy environment variable to ignore any proxy settings for these domains. the curl_ca_bundle environment variable can be used to identify an alternative certificate bundle to be used with an HTTPS proxy. π
setting a HTTP proxy on Unix for example looks like this:
$ export http_proxy="http://proxy.example.com:8080"
proxy authentication is also supported:
$ export http_proxy="http://user1:mypass@proxy.example.org:8081"
setting a proxy on the Windows command prompt:
C:\> set http_proxy=http://proxy.example.com:8080
and that's the proxy situation, bestie π
β¨ PERFORMED CHECKS β¨
Okay bestie, before literally anything else happens, every single URL has to pass a preliminary syntax test π . Tiny little quoting oopsies? Those just get a warning, no biggie. But every other kind of invalid syntax?? That's an error, periodt. Once the syntax check is passed, the URL gets queued up for connection checking. And here's the whole menu of connection check types π
- HTTP links (
http:,https:) β After connecting to the given HTTP server, the given path or query is requested. All redirections are followed, and if user/password is given it will be used as authorization when necessary. All final HTTP status codes other than2xxare errors. Also, HTML page contents are checked for recursion. π - Local files (
file:) β A regular, readable file that can be opened is valid. A readable directory is also valid. All other files, for example device files, unreadable or non-existing files, are errors. HTML or other parseable file contents are checked for recursion. ποΈ - Mail links (
mailto:) β Amailto:link eventually resolves to a list of email addresses. And the way it works is, if one address fails, the whole list fails π. For each mail address we check the following things:- Check the address syntax, both the parts before and after the
@sign. - Look up the MX DNS records. If we found no MX record, print an error.
- Check if one of the mail hosts accept an SMTP connection. Check hosts with higher priority first. If no host accepts SMTP, we print a warning.
- Try to verify the address with the
VRFYcommand. If we got an answer, print the verified address as an info.
- Check the address syntax, both the parts before and after the
- FTP links (
ftp:) β For FTP links we do:- connect to the specified host
- try to login with the given user and password. The default user is
anonymous, the default password isanonymous@. - try to change to the given directory
- list the file with the
NLSTcommand
- Unsupported links (
javascript:, etc.) β An unsupported link will only print a warning. No further checking will be made, we're not even gonna try π.
The complete list of recognized, but unsupported links can be found in the linkcheck/checker/unknownurl.py source file. The most prominent of them should be JavaScript links.
πΊοΈ SITEMAPS πΊοΈ
Sitemaps are parsed for links to check, and they can be detected in two ways: either from a sitemap entry in a robots.txt, or when passed as a FILE-OR-URL argument β and in that second case, detection requires the urlset/sitemapindex tag to be within the first 70 characters of the sitemap. Also, heads up: compressed sitemap files are not supported. π
π§© PLUGINS π§©
There are two plugin types: connection and content plugins. Connection plugins are run after a successful connection to the URL host. Content plugins are run if the URL type has content (mailto: URLs have no content for example) and if the check is not forbidden (ie. by HTTP robots.txt).
Use the option --list-plugins for a list of plugins and their documentation. All plugins are enabled via the linkcheckerrc(5) configuration file. β¨
π RECURSION π
Before descending recursively into a URL, it has to fulfill several conditions. They are checked in this order, no skipping the line bestie:
- A URL must be valid.
- A URL must be parseable. This currently includes HTML files, Opera bookmarks files, and directories. If a file type cannot be determined (for example it does not have a common HTML file extension, and the content does not look like HTML), it is assumed to be non-parseable.
- The URL content must be retrievable. This is usually the case except for example
mailto:or unknown URL types. - The maximum recursion level must not be exceeded. It is configured with the
--recursion-leveloption and is unlimited per default. - It must not match the ignored URL list. This is controlled with the
--ignore-urloption. - The Robots Exclusion Protocol must allow links in the URL to be followed recursively. This is checked by searching for a
"nofollow"directive in the HTML header data.
Note that the directory recursion reads all files in that directory, not just a subset like index.htm. Like, all of them. Every single one. π«Ά
π NOTES π
URLs on the commandline starting with ftp. are treated like ftp://ftp., and URLs starting with www. are treated like http://www.. You can also give local files as arguments. If you have your system configured to automatically establish a connection to the internet (e.g. with diald), it will connect when checking links not pointing to your local host. Use the --ignore-url option to prevent this. π
Javascript links are not supported.
If your platform does not support threading, LinkChecker disables it automatically.
You can supply multiple user/password pairs in a configuration file.
π ENVIRONMENT π
http_proxyβ specifies default HTTP proxy serverhttps_proxyβ specifies default HTTPS proxy servercurl_ca_bundleβ an alternative certificate bundle to be used with an HTTPS proxyno_proxyβ comma-separated list of domains to not contact over a proxy serverLC_MESSAGES,LANG,LANGUAGEβ specify output language
π¦ RETURN VALUE π¦
The return value is 2 when
- a program error occurred.
The return value is 1 when
- invalid links were found or
- link warnings were found and warnings are enabled
Else the return value is zero. Clean run, iconic behaviour π
π LIMITATIONS π
LinkChecker consumes memory for each queued URL to check. With thousands of queued URLs the amount of consumed memory can become quite large. This might slow down the program or even the whole system. So like, be mindful bestie, don't queue a million URLs and then blame the tool π«
π FILES π
$XDG_CONFIG_HOME/linkchecker/linkcheckerrcβ default configuration file$XDG_DATA_HOME/linkchecker/failuresβ default failures logger output filenamelinkchecker-out.TYPEβ default logger file output name
π SEE ALSO π
linkcheckerrc(5)https://docs.python.org/library/codecs.html#standard-encodingsβ valid output encodingshttps://docs.python.org/howto/regex.htmlβ regular expression documentation
π AUTHOR π
Bastian Kleineidam <bastian.kleineidam@web.de>
π COPYRIGHT π
2000-2016 Bastian Kleineidam, 2010-2025 LinkChecker Authors
And that's a wrap on the whole page, bestie! This lil manual is for version 10.5.0.post14+g8c3a6f77, dated July 28, 2025 β go forth and check those links, you absolute main character π¦β¨ LINKCHECKER(1) forever π
π¦ where this page comes from
- fedora 44: linkchecker 10.6.0-2.fc44 Β· GPL-2.0-or-later
- nixos 26.05: linkchecker 10.6.0
- nixpkgs unstable: linkchecker 10.6.0
- ubuntu resolute: linkchecker 10.6.0-2 Β· GPL-2.0-only
- ubuntu stonking: linkchecker 10.6.0-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms