Code Snippets: Link Checking with curl

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:

Now, place your links, one per line, in the file links, e.g.

Then, make the script executable and run it. Links will be checked, and the HTTP status code of each one returned.