How to find broken links of website using command line interface (CLI) (Using wget)

Check the broken links on website using. Try below example command which generate the wget.log it list all the broken links.

  1. Download & Install wget
  2. Add the installation directory to PATH:
    C:\Program Files (x86)\GnuWin32\bin

Syntax:

wget -o wget.log -r -l 10 --spider http://example.com

Usage:

wget -o wget.log -r -l 10 --spider https://maheshwaghmare.wordpress.com --no-check-certificate

Output:

Spider mode enabled. Check if remote file exists.
--2018-06-29 10:11:59-- https://maheshwaghmare.wordpress.com/
Connecting to maheshwaghmare.wordpress.com|192.0.78.12|:443... connected.
WARNING: cannot verify maheshwaghmare.wordpress.com's certificate, issued by `/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certs.godaddy.com/repository//CN=Go Daddy Secure Certificate Authority - G2':
Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `maheshwaghmare.wordpress.com/index.html'

0K .......... .......... .......... .......... .......... 318K
50K .......... .......... .......... .......... .......... 80.5K
100K .......... .......... .......... .......... .......... 664K
150K .......... .......... .......... .......... .......... 2.07M
200K ..... 5.80M=0.9s

2018-06-29 10:12:01 (234 KB/s) - `maheshwaghmare.wordpress.com/index.html' saved [210113]
Advertisements