Section: User Commands (1)
Updated: Jan 2000Index
blnkcheck - search html pages for broken links
[-AafhOs] [-n ignore-list ] [-w list ] html-files
searches html files for broken links. I searches only the relative linksand does not need a web-server. As it does not need web-access it isvery fast. The output of blnkcheck
is of the same format as gcc error messagesand can therefore be interpreted by many common editors (e.g emacs or vim).After editing a some html pages you can just type:blnkcheck
and blnkcheck will check that the links in these pages are correct.
blnkcheck checks the relative filesystem links. These are links of the form:
All tags containg relative links withhref=...,src=...,and background=...are checked.
- Do not open any other files than the files given on thecommand line. Normally blnkcheckwill validate all references to named anchors (something likehref="index.html#anchor"). With this option set only the named anchorsin the files that are anyhow read are checked and for the others onlythe existence of the file (index.html in the above case) is verified.
- Display a list of the absolute links of the form "protocol://". These links are not checked byblnkcheck.The output produced with this option can be post-processed by httpcheck.E.g:
blnkcheck -a *.html | httpcheck -e
Note: -a does not list href="mailto:xx".
- Print only absolute filesystem links. Note: blnkcheck does not validate these links, but you can post process them e.g withsome shell script. In this shell script you can also take care of "Alias" definitions for web pages on your server. (Such a shell script iscurrently not provided together with blnkcheck. Let me know if you wrote a good generic script that could be included.)
- Prints a little help/usage information.
- -n list
- Ignore links that match the given sub-sting.from the list. The list is a comma seperated list of stings.This function is case in-senitive.
- Don't print a warning when a file is not readable by others (not worldreadable).
- Print some statistic about the checked links at the end of the search.This option can not be used together with -a or -f.
- -w list
- Warn about absolute links (ftp://, http://, https:// , /home/ etc.) which matche any of the sub-strings in the list. The list is a comma seperated list of sub-strings.This is useful to detect pages that use absolute links within your ownserver. A strategy that should be avoided as the pages can not be mirrored or ported to other sites.This function is case in-senitive.
Check links in html files in the web server root directory (/home/httpd/html) and in all directories one level down:
(cd /home/httpd/html; blnkcheck *.html */*.html)
Check links in all html files on the server:
(cd /home/httpd/html; blnkcheck `find . -name '*.htm*' -print` | sort)
You can use the vim editor Quickfix mode or the emacs/xemacs M-x compileto parse the output of blnkcheck. This gives you the possibility to openthe concerned web page and jump directly to the line where the broken link is.To do this you can write a Makefile that looks e.g as follows:
blnkcheck `find . -name '*.htm*' -print` | sort
no known bugs
Guido Socher (guido.socherAATTlinuxfocus.org)
is designed as a fast checker for web masters that have shell andfile system level access to their web-pages. It can also be used ifyou are able to keep a mirror of the web site on your local disk.
Other programs like e.g curl (http://curl.haxx.nu/) canbe used if you want to check your web-pages only remotely via a web server.curl comes also with a dead link checker called checklinks.pl.
hrefgrep(1), srcgrep(1), webfgrep(1), httpcheck(1), lshtmlref(1)
- SEE ALSO
This document was created byman2html,using the manual pages.