CHECKLINK(1p)
๐ CHECKLINK(1p) โ the W3Cยฎ Link Checker, but make it a bestie briefing ๐
okay so real quick, the manual name up top is checklink, it lives in the User Contributed Perl Documentation corner of the man pages, and yes bestie, it's giving 1p energy. let's get into it ๐ฆ
โจ NAME โจ
checklink โ check the validity of links in an HTML or XHTML document ๐โจ
๐ธ SYNOPSIS ๐ธ
checklink [ options ] uri ...
that's it. that's the whole vibe. you give it options and one or more URIs. slay. ๐
๐ DESCRIPTION ๐
okay so first of all, this manual page is just the lil quick-and-dirty overview of the checklink command, aka the W3Cยฎ Link Checker. icon behavior, no notes. ๐
so what does it actually do, you ask? it reads an HTML or XHTML document, extracts a whole list of anchors and links, and then:
- checks that no anchor is defined twice ๐
- checks that all the links are dereferenceable, and yes that includes the fragments (iykyk)
- warns you about HTTP redirects, including directory redirects, because redirects are messy and it's not here to be quiet about them
- can check recursively a part of a web site, which is either incredibly useful or a great way to lose an afternoon, depending ๐
and the way that it can be used either as a command line tool or as a CGI script?? versatile. multi-talented. main character energy fr fr. โจ
๐ซถ OPTIONS ๐ซถ
this program follows the usual GNU command line syntax, with long options starting with two dashes (-). a summary of options is included below, and bestie I am not skipping a single one, we're doing all of them ๐
-?,-h,--helpโ show summary of options. the "wait what does this do again" button ๐ฅบ-V,--versionโ output version information. ๐ท๏ธ-s,--summaryโ show result summary only. just the highlights, no yapping โจ-b,--brokenโ show only the broken links, not the redirects. ๐ only the casualties, bestie-e,--dir-redirectsโ hide directory redirects โ e.g.<http://www.w3.org/TR>-><http://www.w3.org/TR/>. ๐ those lil slashes, honestly-r,--recursiveโ check the documents linked from the first one. it goes deeper ๐-D,--depth nโ check the documents linked from the first one to depth n (implies--recursive). how deep are we going bestie ๐-l,--location uriโ scope of the documents checked (implies--recursive). can be specified multiple times in order to specify multiple recursion bases. if the URI of a candidate document is downwards relative to any of the bases, it is considered to be within the scope. if not specified, the default is the base URI of the initial document โ for example, for<http://www.w3.org/TR/html4/Overview.html>it would be<http://www.w3.org/TR/html4/>. ๐บ๏ธ knowing your boundaries is self care-X,--exclude regexpโ do not check links whose full, canonical URIs match regexp. โ ๏ธ note that this option limits recursion the same way as--exclude-docswith the same regular expression would. โ๏ธ--exclude-docs regexpโ in recursive mode, do not check links in documents whose full, canonical URIs match regexp. this option may be specified multiple times. ๐ซ๐--suppress-redirect URI->URIโ do not report a redirect from the first to the second URI. the"->"is literal text. this option may be specified multiple times. whitespace may be used instead of"->"to separate the URIs. ๐คซ--suppress-redirect-prefix URI->URIโ do not report a redirect from a child of the first URI to the same child of the second URI. the"->"is literal text. this option may be specified multiple times. whitespace may be used instead of"->"to separate the URIs. ๐ค--suppress-temp-redirectsโ do not report warnings about temporary redirects. it's just passing through, let it live ๐ฌ๏ธ--suppress-broken CODE:URIโ do not report a broken link with the given CODE. CODE is the HTTP response, or-1for robots exclusion. the":"is literal text. this option may be specified multiple times. whitespace may be used instead of":"to separate the CODE and the URI. ๐ฉน--suppress-fragment URIโ do not report the given broken fragment URI. a fragment URI contains"#". this option may be specified multiple times. ๐งฉ-L,--languages accept-languageโ the"Accept-Language"HTTP header to send. in command line mode, this header is not sent by default. the special value"auto"causes a value to be detected from the"LANG"environment variable, and sent if found. in CGI mode, the default is to send the value received from the client as is. ๐๐ฃ๏ธ-c,--cookies cookie-fileโ use cookies, load/save them in cookie-file. the special value"tmp"causes non-persistent use of cookies, i.e. they are used but only stored in memory for the duration of this link checker run. ๐ช iconic-R,--no-refererโ do not send the"Referer"HTTP header. ๐ต๏ธโ๏ธ-q,--quietโ no output if no errors are found. implies--summary. ๐คซโจ-v,--verboseโ verbose mode. tell me EVERYTHING ๐ฃ๏ธ-i,--indicatorโ show progress while parsing as percentage of lines processed. no indicator is shown for documents containing no linefeeds. ๐-u,--user usernameโ specify a username for authentication. ๐ชช-p,--password passwordโ specify a password for authentication. ๐--hide-same-realmโ hide 401's that are in the same realm as the document checked. ๐-S,--sleep secsโ sleep the specified number of seconds between requests to each server. defaults to 1 second, which is also the minimum allowed. ๐ด be polite to servers bestie-t,--timeout secsโ timeout for requests, in seconds. the default is 30. โฑ๏ธ-C,--connection-cache numberโ maximum number of cached connections. using this option overrides the"Connection_Cache_Size"configuration file parameter โ see its documentation below for the default value and more information. ๐๏ธ-d,--domain domainโ Perl regular expression describing the domain to which the authentication information (if present) will be sent. the default value can be specified in the configuration file. see the"Trusted"entry in the configuration file description below for more information. ๐ฐ--masquerade "real-prefix surrogate-prefix"โ perform a simple string substitution: URIs which begin with the string"real-prefix"are rewritten using the"surrogate-prefix"before being dereferenced. useful for making a local directory masquerade as a remote one. for example:
--masquerade "http://example.com/x/y/z/ file:///my/local/dir/"
if the document being checked contains a link to http://example.com/x/y/z/foo.html, then the local file system will be checked for file:///my/local/dir/foo.html.
--masquerade takes a single argument consisting of two URIs, separated by whitespace. the quote marks are not part of the argument, but one usual way of providing a value with embedded whitespace is to enclose it in quotes. ๐ญ
-H,--htmlโ HTML output. ๐
๐ง FILES ๐ง
/etc/w3c/checklink.confโ the main configuration file. you can use theW3C_CHECKLINK_CFGenvironment variable to override the default location. ๐
"Trusted" specifies a regular expression for matching trusted domains (ie. domains where HTTP basic authentication, if any, will be sent). the regular expression will be matched case insensitively against host names. the default behavior (when unset, that is) is to send the authentication information only to the host which requests it; usually you don't want to change this. for example, the following configures only the w3.org domain as trusted:
Trusted = \.w3\.org$
"Allow_Private_IPs" is a boolean flag indicating whether checking links on non-public IP addresses is allowed. the default is true in command line mode and false when run as a CGI script. for example, to disallow checking non-public IP addresses, regardless of the mode, use:
Allow_Private_IPs = 0
"Forbidden_Protocols" is a comma separated list of additional protocols/URI schemes that the link checker is not allowed to use. the "javascript" and "mailto" schemes are always forbidden, and so is the "file" scheme when running as a CGI script.
Forbidden_Protocols = javascript,mailto
"Markup_Validator_URI" and "CSS_Validator_URI" are formatted URIs to the respective validators. the %s in these will be replaced with the full "URI encoded" URI to the document being checked, and shown in the link checker results view in the online/CGI version. the defaults are:
Markup_Validator_URI =
http://validator.w3.org/check?uri=%s
CSS_Validator_URI =
http://jigsaw.w3.org/css-validator/validator?uri=%s
"Doc_URI" is a URI used for linking to the documentation, and CSS and JavaScript files in the dynamically generated content of the link checker. the default is:
Doc_URI = http://validator.w3.org/docs/checklink.html
"Connection_Cache_Size" is an integer denoting the maximum number of connections the link checker will keep open at any given time. the default is:
Connection_Cache_Size = 2
๐ ENVIRONMENT ๐
checklink uses the libwww-perl library, which has a number of environment variables affecting its behaviour. see "SEE ALSO" for some pointers. ๐
W3C_CHECKLINK_CFGโ if set, overrides the path to the configuration file. ๐ ๏ธ
๐ SEE ALSO ๐
the documentation for this program is available on the web at <http://validator.w3.org/docs/checklink.html>. ๐
LWP, Net::FTP, Net::NNTP, Net::IP, perlre. ๐ซถ
๐ AUTHOR ๐
this program was originally written by Hugo Haas <hugo@w3.org>, based on Renaud Bruyeron's checklink.pl. it has been enhanced by Ville Skyttรค and many other volunteers since. use the <www-validator@w3.org> mailing list for feedback, and see <http://validator.w3.org/docs/checklink.html#csb> for more information. ๐
this manual page was originally written by Frรฉdรฉric Schรผtz <schutz@mathgen.ch> for the Debian GNU/Linux system (but may be used by others). ๐ง
โญ COPYRIGHT โญ
this program is licensed under the W3Cยฎ Software License, <http://www.w3.org/Consortium/Legal/copyright-software>. ๐
and that's the whole page bestie!! this version came from perl v5.36.0 dated 2022-10-02, so if you're reading a different build, that's a different era okay?? go check some links, be nice to servers, and hydrate ๐๐ฆ๐ธโจ
๐ฆ where this page comes from
- ubuntu noble: w3c-linkchecker 5.0.0-2 ยท W3C-Software
- ubuntu questing: w3c-linkchecker 5.0.0-2
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms