Even though there are many link checking utilities and scripts available, a simple concise report can be generated using curl.
Create a script, link_checker.sh, and paste the following code:
|
1 2 3 4 5 6 |
#!/bin/bash while read URL; do RESULT=$(curl -s -o /dev/null --connect-timeout 2 -w%{http_code} ${URL}) echo "${URL} [${RESULT}]" done < ./links exit 0 |
Now, place your links, one per line, in the file links, e.g.
|
1 2 3 |
http://www.foo.com/page_one.html http://www.foo.com/page_two.html http://www.foo.com/page_three.html |
Then, make the script executable and run it. Links will be checked, and the HTTP status code of each one returned.